diff --git a/Gemfile b/Gemfile index 9f31edad1..a599613ba 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org/' -### 这里执行bundle config mirror.https://rubygems.org https://gems.ruby-china.org 切换到ruby-china源 +### 锟斤拷锟斤拷执锟斤拷bundle config mirror.https://rubygems.org https://gems.ruby-china.org 锟叫伙拷锟斤拷ruby-china源 unless RUBY_PLATFORM =~ /w32/ # unix-like only diff --git a/Gemfile.lock~ b/Gemfile.lock~ new file mode 100644 index 000000000..7d6563465 --- /dev/null +++ b/Gemfile.lock~ @@ -0,0 +1,386 @@ +GIT + remote: http://github.com/guange2015/wechat.git + revision: a18c3d6603cb1aa7bd1fe887b17f67426be01f35 + specs: + wechat (0.7.1) + activerecord (>= 3.2, < 5.1.x) + http (~> 1.0, >= 1.0.1) + nokogiri (>= 1.6.0) + thor + +PATH + remote: lib/gitlab-cli + specs: + gitlab (3.2.0) + httparty + terminal-table + +PATH + remote: lib/grack + specs: + grack (2.0.2) + rack (~> 1.4.5) + +PATH + remote: lib/rails_kindeditor + specs: + rails_kindeditor (0.4.5) + carrierwave + mini_magick + +GEM + remote: https://ruby.taobao.org/ + specs: + actionmailer (3.2.22.2) + actionpack (= 3.2.22.2) + mail (~> 2.5.4) + actionpack (3.2.22.2) + activemodel (= 3.2.22.2) + activesupport (= 3.2.22.2) + builder (~> 3.0.0) + erubis (~> 2.7.0) + journey (~> 1.0.4) + rack (~> 1.4.5) + rack-cache (~> 1.2) + rack-test (~> 0.6.1) + sprockets (~> 2.2.1) + activemodel (3.2.22.2) + activesupport (= 3.2.22.2) + builder (~> 3.0.0) + activerecord (3.2.22.2) + activemodel (= 3.2.22.2) + activesupport (= 3.2.22.2) + arel (~> 3.0.2) + tzinfo (~> 0.3.29) + activeresource (3.2.22.2) + activemodel (= 3.2.22.2) + activesupport (= 3.2.22.2) + activesupport (3.2.22.2) + i18n (~> 0.6, >= 0.6.4) + multi_json (~> 1.0) + acts-as-taggable-on (2.4.1) + rails (>= 3, < 5) + addressable (2.4.0) + ansi (1.5.0) + arel (3.0.3) + axiom-types (0.1.1) + descendants_tracker (~> 0.0.4) + ice_nine (~> 0.11.0) + thread_safe (~> 0.3, >= 0.3.1) + better_errors (1.1.0) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) + builder (3.0.0) + byebug (8.2.2) + carrierwave (0.10.0) + activemodel (>= 3.2.0) + activesupport (>= 3.2.0) + json (>= 1.7) + mime-types (>= 1.16) + chinese_pinyin (1.0.0) + climate_control (0.0.3) + activesupport (>= 3.0) + cocaine (0.5.8) + climate_control (>= 0.0.3, < 1.0) + coderay (1.1.1) + coercible (1.0.0) + descendants_tracker (~> 0.0.1) + coffee-rails (3.2.2) + coffee-script (>= 2.2.0) + railties (~> 3.2.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.10.0) + daemons (1.2.3) + debug_inspector (0.0.2) + delayed_job (4.1.1) + activesupport (>= 3.0, < 5.0) + delayed_job_active_record (4.1.0) + activerecord (>= 3.0, < 5) + delayed_job (>= 3.0, < 5) + descendants_tracker (0.0.4) + thread_safe (~> 0.3, >= 0.3.1) + diff-lcs (1.2.5) + domain_name (0.5.20160216) + unf (>= 0.0.5, < 1.0.0) + elasticsearch (1.0.15) + elasticsearch-api (= 1.0.15) + elasticsearch-transport (= 1.0.15) + elasticsearch-api (1.0.15) + multi_json + elasticsearch-model (0.1.8) + activesupport (> 3) + elasticsearch (> 0.4) + hashie + elasticsearch-rails (0.1.8) + elasticsearch-transport (1.0.15) + faraday + multi_json + equalizer (0.0.11) + erubis (2.7.0) + execjs (2.6.0) + factory_girl (4.5.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.6.0) + factory_girl (~> 4.5.0) + railties (>= 3.0.0) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + fastercsv (1.5.5) + grape (0.9.0) + activesupport + builder + hashie (>= 2.1.0) + multi_json (>= 1.3.2) + multi_xml (>= 0.5.2) + rack (>= 1.3.0) + rack-accept + rack-mount + virtus (>= 1.0.0) + grape-entity (0.4.8) + activesupport + multi_json (>= 1.3.2) + grape-swagger (0.10.4) + grape (>= 0.8.0) + grape-entity (< 0.5.0) + hashie (3.4.3) + hike (1.2.3) + htmlentities (4.3.4) + http (1.0.2) + addressable (~> 2.3) + http-cookie (~> 1.0) + http-form_data (~> 1.0.1) + http_parser.rb (~> 0.6.0) + http-cookie (1.0.2) + domain_name (~> 0.5) + http-form_data (1.0.1) + http_parser.rb (0.6.0) + httparty (0.13.7) + json (~> 1.8) + multi_xml (>= 0.5.2) + i18n (0.6.11) + ice_nine (0.11.2) + iconv (1.0.4) + journey (1.0.4) + jquery-rails (2.0.3) + railties (>= 3.1.0, < 5.0) + thor (~> 0.14) + json (1.8.3) + kaminari (0.16.3) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) + libv8 (3.16.14.13) + mail (2.5.4) + mime-types (~> 1.16) + treetop (~> 1.4.8) + method_source (0.8.2) + mime-types (1.25.1) + mini_magick (4.4.0) + mini_portile2 (2.0.0) + multi_json (1.11.2) + multi_xml (0.5.5) + multipart-post (2.0.0) + mysql2 (0.3.18) + net-ldap (0.3.1) + netrc (0.11.0) + nokogiri (1.6.7.2) + mini_portile2 (~> 2.0.0.rc2) + paperclip (3.5.4) + activemodel (>= 3.0.0) + activesupport (>= 3.0.0) + cocaine (~> 0.5.3) + mime-types + polyglot (0.3.5) + pry (0.10.3) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-byebug (3.3.0) + byebug (~> 8.0) + pry (~> 0.10) + pry-rails (0.3.4) + pry (>= 0.9.10) + pry-stack_explorer (0.4.9.2) + binding_of_caller (>= 0.7) + pry (>= 0.9.11) + rack (1.4.7) + rack-accept (0.4.5) + rack (>= 0.4) + rack-cache (1.6.1) + rack (>= 0.4) + rack-cors (0.4.0) + rack-mount (0.8.3) + rack (>= 1.0.0) + rack-openid (1.4.2) + rack (>= 1.1.0) + ruby-openid (>= 2.1.8) + rack-raw-upload (1.1.1) + multi_json + rack-ssl (1.3.4) + rack + rack-test (0.6.3) + rack (>= 1.0) + rails (3.2.22.2) + actionmailer (= 3.2.22.2) + actionpack (= 3.2.22.2) + activerecord (= 3.2.22.2) + activeresource (= 3.2.22.2) + activesupport (= 3.2.22.2) + bundler (~> 1.0) + railties (= 3.2.22.2) + railties (3.2.22.2) + actionpack (= 3.2.22.2) + activesupport (= 3.2.22.2) + rack-ssl (~> 1.3.2) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (>= 0.14.6, < 2.0) + rake (10.5.0) + rdoc (3.12.2) + json (~> 1.4) + redis (3.2.2) + redis-actionpack (3.2.4) + actionpack (~> 3.2.0) + redis-rack (~> 1.4.4) + redis-store (~> 1.1.4) + redis-activesupport (3.2.5) + activesupport (~> 3.2.0) + redis-store (~> 1.1.0) + redis-rack (1.4.4) + rack (~> 1.4.0) + redis-store (~> 1.1.4) + redis-rails (3.2.4) + redis-actionpack (~> 3.2.4) + redis-activesupport (~> 3.2.4) + redis-store (~> 1.1.4) + redis-store (1.1.7) + redis (>= 2.2) + ref (2.0.0) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + rich (1.4.6) + jquery-rails + kaminari + mime-types + paperclip + rack-raw-upload + rails (>= 3.2.0) + sass-rails + rspec-core (3.4.3) + rspec-support (~> 3.4.0) + rspec-expectations (3.4.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.4.0) + rspec-mocks (3.4.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.4.0) + rspec-rails (3.4.2) + actionpack (>= 3.0, < 4.3) + activesupport (>= 3.0, < 4.3) + railties (>= 3.0, < 4.3) + rspec-core (~> 3.4.0) + rspec-expectations (~> 3.4.0) + rspec-mocks (~> 3.4.0) + rspec-support (~> 3.4.0) + rspec-support (3.4.1) + ruby-ole (1.2.12) + ruby-openid (2.1.8) + rubyzip (1.2.0) + sass (3.4.21) + sass-rails (3.2.6) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + seems_rateable (1.0.13) + jquery-rails + rails + slop (3.6.0) + spreadsheet (1.1.1) + ruby-ole (>= 1.0) + sprockets (2.2.3) + hike (~> 1.2) + multi_json (~> 1.0) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + terminal-table (1.5.2) + therubyracer (0.12.2) + libv8 (~> 3.16.14.0) + ref + thor (0.19.1) + thread_safe (0.3.5) + tilt (1.4.1) + treetop (1.4.15) + polyglot + polyglot (>= 0.3.1) + tzinfo (0.3.46) + uglifier (2.7.2) + execjs (>= 0.3.0) + json (>= 1.8.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.2) + virtus (1.0.5) + axiom-types (~> 0.1) + coercible (~> 1.0) + descendants_tracker (~> 0.0, >= 0.0.3) + equalizer (~> 0.0, >= 0.0.9) + +PLATFORMS + ruby + +DEPENDENCIES + acts-as-taggable-on (= 2.4.1) + ansi + better_errors (~> 1.1.0) + binding_of_caller + builder (= 3.0.0) + chinese_pinyin + coderay (~> 1.1.0) + coffee-rails (~> 3.2.1) + daemons + delayed_job_active_record + elasticsearch-model + elasticsearch-rails + factory_girl_rails + fastercsv (~> 1.5.0) + gitlab! + grack! + grape (~> 0.9.0) + grape-entity + grape-swagger + htmlentities + i18n (~> 0.6.0) + iconv + jquery-rails (~> 2.0.2) + kaminari + mysql2 (= 0.3.18) + net-ldap (~> 0.3.1) + paperclip (~> 3.5.4) + pry-byebug + pry-rails + pry-stack_explorer + rack-cors + rack-openid + rails (~> 3.2) + rails_kindeditor! + redis-rails + rest-client + rich (= 1.4.6) + rspec-rails (~> 3.0) + ruby-ole + ruby-openid (~> 2.1.4) + rubyzip + sass-rails (~> 3.2.3) + seems_rateable (~> 1.0.13) + spreadsheet + therubyracer + uglifier (>= 1.0.3) + wechat! + +BUNDLED WITH + 1.10.6 diff --git a/Gemfile~ b/Gemfile~ new file mode 100644 index 000000000..24869e72b --- /dev/null +++ b/Gemfile~ @@ -0,0 +1,112 @@ +source 'http://rubygems.org/' +### 这里执行bundle config mirror.https://rubygems.org https://gems.ruby-china.org 切换到ruby-china源 + +unless RUBY_PLATFORM =~ /w32/ + # unix-like only + gem 'iconv' +end + +gem 'certified' + +gem 'wechat',path: 'lib/wechat' +gem 'grack', path:'lib/grack' +gem 'gitlab', path: 'lib/gitlab-cli' +gem 'rest-client' +gem "mysql2", "= 0.3.18" +gem 'redis-rails' +gem 'rubyzip' +gem 'delayed_job_active_record'#, :group => :production +gem 'daemons' +gem 'grape', '~> 0.9.0' +gem 'grape-entity' +gem 'rack-cors', :require => 'rack/cors' +gem 'seems_rateable', '~> 1.0.13' +gem 'rails', '~> 3.2' +gem "jquery-rails", "~> 2.0.2" +gem "i18n", "~> 0.6.0" +gem 'coderay', '~> 1.1.0' +gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] +gem "builder", "3.0.0" +gem 'acts-as-taggable-on', '2.4.1' +gem 'spreadsheet' +gem 'ruby-ole' +gem 'rails_kindeditor',path:'lib/rails_kindeditor' +#gem "rmagick", ">= 2.0.0" +gem 'binding_of_caller' +gem 'chinese_pinyin' +# gem 'sunspot_rails', '~> 1.3.3' +# gem 'sunspot_solr' +# gem 'sunspot' +# gem 'progress_bar' +gem 'ansi' + +gem 'kaminari' +gem 'elasticsearch-model' +gem 'elasticsearch-rails' + + +### profile +#gem 'oneapm_rpm' + +group :development do + gem 'grape-swagger' + gem 'better_errors', '~> 1.1.0' + # gem "query_reviewer" + # gem 'rack-mini-profiler', '~> 0.9.3' + if RUBY_PLATFORM =~ /w32/ + gem 'win32console' + end +end + +group :development, :test do + unless RUBY_PLATFORM =~ /w32/ + gem 'pry-rails' + if RUBY_VERSION >= '2.0.0' + gem 'pry-byebug' + end + gem 'pry-stack_explorer' + if RUBY_PLATFORM =~ /darwin/ + gem 'puma' + end + end + + gem 'rspec-rails', '~> 3.0' + gem 'factory_girl_rails' +end + +# Gems used only for assets and not required +# in production environments by default. +group :assets do + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' + + # See https://github.com/sstephenson/execjs#readme for more supported runtimes + gem 'therubyracer', :platforms => :ruby + + gem 'uglifier', '>= 1.0.3' +end + +# Optional gem for LDAP authentication +group :ldap do + gem "net-ldap", "~> 0.3.1" +end + + +# Optional gem for OpenID authentication +group :openid do + gem "ruby-openid", "~> 2.1.4", :require => "openid" + gem "rack-openid" +end + + +database_file = File.join(File.dirname(__FILE__), "config/database.yml") +if File.exist?(database_file) +else + warn("Please configure your config/database.yml first") +end + +# Load plugins' Gemfiles +Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file| + puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v` + instance_eval File.read(file) +end diff --git a/app/api/mobile/apis/activities.rb b/app/api/mobile/apis/activities.rb index 94ee14a56..cbd43bb79 100644 --- a/app/api/mobile/apis/activities.rb +++ b/app/api/mobile/apis/activities.rb @@ -33,10 +33,10 @@ module Mobile shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id) shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id) page = params[:page] ? params[:page] : 0 - user_project_ids = (user.projects.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.map{|project| project.id}-shield_project_ids).join(",") + ")" - user_course_ids = (user.courses.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.map{|course| course.id}-shield_course_ids).join(",") + ")" + user_project_ids = (user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.map{|project| project.id}-shield_project_ids).join(",") + ")" + user_course_ids = (user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.map{|course| course.id}-shield_course_ids).join(",") + ")" course_types = "('Message','News','HomeworkCommon','Poll','Course')" - project_types = "('Message','Issue','ProjectCreateInfo')" + project_types = "('Message','Issue','Project')" principal_types = "JournalsForMessage" watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(',')) user_ids = "(" + user.id.to_s + watched_user_ids + ")" diff --git a/app/api/mobile/entities/activity.rb b/app/api/mobile/entities/activity.rb index 20876bf69..3ba82bcb9 100644 --- a/app/api/mobile/entities/activity.rb +++ b/app/api/mobile/entities/activity.rb @@ -14,7 +14,7 @@ module Mobile else case f when :user_act - if ac.act_type == "ProjectCreateInfo" + if ac.act_type == "Project" ac unless ac.nil? else ac.act unless ac.nil? || ac.act.nil? @@ -84,10 +84,10 @@ module Mobile elsif ac.container_type == "Project" case ac.act_type when "Issue" - "椤圭洰缂洪櫡" + "椤圭洰闂" when "Message" "椤圭洰璁ㄨ鍖" - when "ProjectCreateInfo" + when "Project" "椤圭洰" end end @@ -101,7 +101,7 @@ module Mobile expose :container_type #璇剧▼/椤圭洰/鍗氬/涓汉 expose :author, using: Mobile::Entities::User do |a, opt| #鐢ㄦ埛淇℃伅 if a.is_a? ::UserActivity - if a.act_type == "ProjectCreateInfo" + if a.act_type == "Project" get_user(get_project(a.act_id).user_id) elsif !a.act.nil? if a.act_type == 'Issue' || a.act_type == 'News' || a.act_type == 'Message' || a.act_type == 'BlogComment' diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d6470ce51..cbce67618 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -363,7 +363,11 @@ class ApplicationController < ActionController::Base when "contest" return true when "Course" - allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false) + if @attachment.get_status_by_attach(User.current.id) == 2 + return true + else + allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false) + end else return true end diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb index fe16385f4..5b29565ad 100644 --- a/app/controllers/at_controller.rb +++ b/app/controllers/at_controller.rb @@ -68,7 +68,7 @@ class AtController < ApplicationController end def find_project(id) - return [] if id<0 + return [] if id.to_i<0 at_persons = Project.find(id).users at_persons.delete_if { |u| u.id == User.current.id } end diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 0fd4cc2c9..17f62f18c 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -162,6 +162,7 @@ class CoursesController < ApplicationController @subPage_title = l :label_student_list @canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1' # @is_remote = true + @sort_type = 'score' @score_sort_by = "desc" q = "#{params[:name].strip}" if params[:incourse] @@ -185,9 +186,11 @@ class CoursesController < ApplicationController group.course_id = @course.id group.save end + @sort_type = 'score' + @score_sort_by = "desc" @canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1' @is_remote = true - @members = student_homework_score(0,0, 10,"desc") + @members = student_homework_score(0,0, 10,@score_sort_by) @course_groups = @course.course_groups end @@ -196,7 +199,9 @@ class CoursesController < ApplicationController @subPage_title = l :label_student_list @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @is_remote = true - + @sort_type = 'score' + @score_sort_by = "desc" + @members = student_homework_score(0,0, 10,@score_sort_by) @course_groups = @course.course_groups end @@ -281,6 +286,7 @@ class CoursesController < ApplicationController @render_file = 'new_member_list' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @is_remote = true + @sort_type = 'score' @score_sort_by = "desc" if params[:group_id] && params[:group_id] != "0" @group = CourseGroup.find(params[:group_id]) @@ -298,6 +304,7 @@ class CoursesController < ApplicationController @render_file = 'new_member_list' @score_sort_by = "desc" + @sort_type = "score" @canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1' @role = params[:role].nil? ? '2':params[:role] @is_remote = true @@ -312,7 +319,7 @@ class CoursesController < ApplicationController if @course.open_student == 1 || User.current.member_of_course?(@course) @subPage_title = l :label_student_list page = params[:page].nil? ? 0 : (params['page'].to_i - 1) - @all_members = student_homework_score(0,page, 10,"desc") + @all_members = student_homework_score(0,page, 10,@score_sort_by) @members = @all_members else render_403 @@ -334,7 +341,7 @@ class CoursesController < ApplicationController def export_course_member_excel @all_members = student_homework_score(0,0,0,"desc") - @homeworks = @course.homework_commons.order("created_at asc") + @homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at asc") filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}"; respond_to do |format| @@ -350,28 +357,29 @@ class CoursesController < ApplicationController @subPage_title = l :label_student_list @render_file = 'new_member_list' @is_remote = true + @sort_type = params[:sort_type] if params[:sort_type] @score_sort_by = params[:sort_by] if params[:sort_by] @search_name = params[:search_name] if params[:search_name] group_id = params[:group_id] if !@search_name.nil? if group_id == '0' page = params[:page].nil? ? 0 : (params['page'].to_i - 1) - @results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by), @search_name) + @results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by,@sort_type), @search_name) @result_count = @results.count # @results = paginateHelper @results, 10 else @group = CourseGroup.find(group_id) - @results = searchmember_by_name(student_homework_score(group_id, 0, 0,@score_sort_by),@search_name) + @results = searchmember_by_name(student_homework_score(group_id, 0, 0,@score_sort_by,@sort_type),@search_name) @result_count = @results.count # @results = paginateHelper @results, 10 end else if group_id == '0' page = params[:page].nil? ? 0 : (params['page'].to_i - 1) - @results = student_homework_score(0,page, 10,@score_sort_by) + @results = student_homework_score(0,page, 10,@score_sort_by,@sort_type) else @group = CourseGroup.find(group_id) - @results = student_homework_score(group_id, 0, 0,@score_sort_by) + @results = student_homework_score(group_id, 0, 0,@score_sort_by,@sort_type) end end end @@ -384,6 +392,15 @@ class CoursesController < ApplicationController end end + # 鏄剧ず姣忎釜瀛︾敓鐨勪綔涓氳瘎鍒嗚鎯 + def show_member_act_score + @member = Member.find(params[:member_id]) if params[:member_id] + respond_to do |format| + format.html {render :layout => 'course_base'} + format.js + end + end + def handle_course courses, activities course_activity_count_array=activities.values() course_array=[] @@ -1149,7 +1166,7 @@ class CoursesController < ApplicationController end end - def student_homework_score(groupid,start_from, nums, score_sort_by) + def student_homework_score(groupid,start_from, nums, score_sort_by, sort_type = 'score') start_from = start_from * nums sql_select = "" if groupid == 0 @@ -1159,11 +1176,13 @@ class CoursesController < ApplicationController WHERE student_works.homework_common_id = homework_commons.id AND homework_commons.course_id = #{@course.id} AND student_works.user_id = members.user_id - ) AS score + ) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 + + resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id + ) AS act_score FROM members JOIN students_for_courses ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id - WHERE members.course_id = #{@course.id} ORDER BY score #{score_sort_by}" + WHERE members.course_id = #{@course.id} ORDER BY #{sort_type} #{score_sort_by}" else sql_select = "SELECT members.*,( SELECT SUM(student_works.work_score) @@ -1171,11 +1190,13 @@ class CoursesController < ApplicationController WHERE student_works.homework_common_id = homework_commons.id AND homework_commons.course_id = #{@course.id} AND student_works.user_id = members.user_id - ) AS score + ) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 + + resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id + ) AS act_score FROM members JOIN students_for_courses ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id - WHERE members.course_id = #{@course.id} AND members.course_group_id = #{groupid} ORDER BY score #{score_sort_by}" + WHERE members.course_id = #{@course.id} AND members.course_group_id = #{groupid} ORDER BY #{sort_type} #{score_sort_by}" end sql = ActiveRecord::Base.connection() homework_scores = Member.find_by_sql(sql_select) @@ -1225,8 +1246,7 @@ class CoursesController < ApplicationController sheet1[5,i+4] = "绗"+(i+1).to_s+"娆" end sheet1[5,homeworks.count+4] = "鎬绘垚缁" - sheet1[5,0] = "鎺掑悕" - sheet1[5,0] = "鎺掑悕" + sheet1[5,homeworks.count+5] = "娲昏穬搴" count_row = 6 members.each_with_index do |member, i| sheet1[count_row,0]= i+1 @@ -1236,14 +1256,15 @@ class CoursesController < ApplicationController homeworks.each_with_index do |homework, j| student_works = homework.student_works.where("user_id = #{member.user.id}") if student_works.empty? - sheet1[count_row,j+4] = format("%0.2f",0) + sheet1[count_row,j+4] = 0 else final_score = student_works.first.final_score.nil? ? 0 : student_works.first.final_score score = final_score - student_works.first.absence_penalty - student_works.first.late_penalty - sheet1[count_row,j+4] = format("%0.2f",score <0 ? 0:score) + sheet1[count_row,j+4] = score <0 ? 0:score.round(2) end end - sheet1[count_row,homeworks.count+4] = format("%0.2f",member.score.nil? ? 0:member.score.to_s) + sheet1[count_row,homeworks.count+4] = member.score.nil? ? 0:member.score.round(2) + sheet1[count_row,homeworks.count+5] = member.act_score.nil? ? 0:member.act_score count_row += 1 end diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 689ef2bd7..9da4b90b9 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -20,15 +20,16 @@ class HomeworkCommonController < ApplicationController @page = params[:page] ? params[:page].to_i + 1 : 0 @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) if @is_teacher - @homeworks = @course.homework_commons.order("updated_at desc").limit(10).offset(@page * 10) + #@homeworks = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10) @homework_commons = @course.homework_commons.order("created_at desc") else - @homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_at desc").limit(10).offset(@page * 10) + #@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10) @homework_commons = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc") end @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) @is_new = params[:is_new] + @homeworks = paginateHelper @homework_commons,10 #璁剧疆at宸茶 @homeworks.each do |homework| homework.journals_for_messages.each do |j| @@ -291,9 +292,9 @@ class HomeworkCommonController < ApplicationController def open_student_works if @homework.is_open == 0 - @homework.update_attribute(:is_open, 1) + @homework.update_column('is_open', 1) else - @homework.update_attribute(:is_open, 0) + @homework.update_column('is_open', 0) end @user_activity_id = params[:user_activity_id] @is_in_course = params[:is_in_course] if params[:is_in_course] @@ -440,7 +441,7 @@ class HomeworkCommonController < ApplicationController puts time s_time = time if format_time(time) > format_time(h.updated_at) - h.update_attribute(:updated_at, s_time) + h.update_column('updated_at', s_time) end end end diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index c6047d227..82062d3dd 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -103,6 +103,7 @@ class OrgDocumentCommentsController < ApplicationController def destroy @org_document_comment = OrgDocumentComment.find(params[:id]) + @org_sub_id = @org_document_comment.org_subfield_id org = @org_document_comment.organization if @org_document_comment.id == org.home_id org.update_attributes(:home_id => nil) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 62876d757..3ab62bbea 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -127,7 +127,7 @@ class OrganizationsController < ApplicationController case params[:type] when nil @org_activities = OrgActivity.where("(container_id =? and container_type =?) " + - "or (container_type ='Project' and org_act_type in ('Issue','Message','ProjectCreateInfo') and container_id in (#{project_ids.join(',')})) "+ + "or (container_type ='Project' and org_act_type in ('Issue','Message','Project') and container_id in (#{project_ids.join(',')})) "+ "or (container_type ='Course' and org_act_type in #{course_types} and container_id in (#{course_ids.join(',')}))", @organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10) when 'project_issue' diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 1d7b4117d..e4cf31f55 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -423,9 +423,13 @@ class PollController < ApplicationController # 灏嗗叾浠栧湴鏂圭殑闂嵎瀵煎嚭鏉 def other_poll # 鏌ヤ綔鑰呮槸鎴戯紝鎴栬呬綔鑰呮槸褰撳墠璇剧▼鐨勮佸笀锛屼笖涓嶅湪褰撳墠璇剧▼鍐呯殑闂嵎 杩涜瀵煎叆 - tea_ids = '(' - tea_ids << Course.find(params[:polls_group_id]).tea_id.to_s << ','<< User.current.id.to_s << ')' - @polls = Poll.where("user_id in #{tea_ids} and polls_type = 'course' and polls_group_id != #{params[:polls_group_id]}") + courses = User.current.courses.select { |course| User.current.allowed_to?(:as_teacher,course)} + course_ids = courses.empty? ? "(-1)" : "(" + courses.map { |course| course.id}.join(',') + ")" + none_courses = User.current.courses.where("is_delete = 1 or #{Course.table_name}.id = #{params[:polls_group_id].to_i}") + none_course_ids = none_courses.empty? ? "(-1)" : "(" + none_courses.map { |course| course.id}.join(',') + ")" + #tea_ids = '(' + #tea_ids << Course.find(params[:polls_group_id]).tea_id.to_s << ','<< User.current.id.to_s << ')' + @polls = Poll.where("(user_id = #{User.current.id} or polls_group_id in #{course_ids}) and polls_type = 'course' and polls_group_id not in #{none_course_ids}") @polls_group_id = params[:polls_group_id] respond_to do |format| format.js diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 258bce756..f518f81da 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -81,6 +81,7 @@ class StudentWorkController < ApplicationController #鏍规嵁浼犲叆鐨則Index纭畾鏄鍑犳娴嬭瘯 #涔嬪悗濡傛灉瑙夊緱寰堝崱 鍙互鏀规垚灏嗙粨鏋滀紶鍥濲S鍐嶄互鍙傛暟褰㈠紡浼犲洖鏉 def program_test_ex + tStarttime = Time.now is_test = params[:is_test] == 'true' @@ -106,108 +107,123 @@ class StudentWorkController < ApplicationController tEndtime = Time.now tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000 logger.debug "program_test_ex user wait time = #{tUsedtime} 姣" - - #status 0:绛旀姝g‘ -3http瓒呮椂 -2:缂栬瘧閿欒 -1:绛旀閿欒 2:绋嬪簭杩愯瓒呮椂 + #status 0:绛旀姝g‘ -5program_test_ex 鍑芥暟鍑洪敊 -4judge浠g爜鍑洪敊 -3http瓒呮椂 -2:缂栬瘧閿欒 -1:绛旀閿欒 2:绋嬪簭杩愯瓒呮椂 + resultObj[:status] = -3 CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>-3,:wait_time=>tUsedtime,:student_work_id=>student_work.id) - - end - if result["status"].to_i != -2 - #result["results"].first['output'] = result["results"].first['output'].gsub(" ","鈻") - #result["results"].first['result'] = result["results"].first['result'].gsub(" ","鈻") - space_replace_1(result["results"].first['output']) - space_replace_1(result["results"].first['result']) + rescue + #-4 judge浠g爜 鍑洪敊 + logger.debug "program_test_error 1" + resultObj[:status] = -4 + tmpstatus = -4 + CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>0,:wait_time=>0,:student_work_id=>student_work.id) end - logger.debug result + begin + if resultObj[:status] != -3 && resultObj[:status] != -4 + if result["status"].to_i != -2 + #result["results"].first['output'] = result["results"].first['output'].gsub(" ","鈻") + #result["results"].first['result'] = result["results"].first['result'].gsub(" ","鈻") + space_replace_1(result["results"].first['output']) + space_replace_1(result["results"].first['result']) + end - #-1 榛樿鍊 0鍏ㄩ儴姝g‘骞剁粨鏉 2 瓒呮椂 -2 缂栬瘧閿欒 - resultObj[:status] = -1 - resultObj[:results] = result["results"].first #鏈娴嬭瘯缁撴灉 - if result["status"].to_i == -2 #缂栬瘧閿欒 - result["error_msg"] = result["error_msg"][0..2047] - end - resultObj[:error_msg] = result["error_msg"] #缂栬瘧閿欒鏃剁殑淇℃伅 + logger.debug result - #璇ョ姸鎬佺敤浜庡瓨鍏odeTests - tmpstatus = -1 - if result["status"].to_i == -2 #缂栬瘧閿欒 - resultObj[:results] = result["error_msg"] - resultObj[:status] = -2 - tmpstatus = -2 - elsif result["results"][0]["status"].to_i == 2 - resultObj[:status] = 2 - tmpstatus = 2 - end + #-1 榛樿鍊 0鍏ㄩ儴姝g‘骞剁粨鏉 2 瓒呮椂 -2 缂栬瘧閿欒 + resultObj[:status] = -1 + resultObj[:results] = result["results"].first #鏈娴嬭瘯缁撴灉 + if result["status"].to_i == -2 #缂栬瘧閿欒 + result["error_msg"] = result["error_msg"][0..2047] + end + resultObj[:error_msg] = result["error_msg"] #缂栬瘧閿欒鏃剁殑淇℃伅 - if result["status"] == 0 - tmpstatus = 0 - end + #璇ョ姸鎬佺敤浜庡瓨鍏odeTests + tmpstatus = -1 + if result["status"].to_i == -2 #缂栬瘧閿欒 + resultObj[:results] = result["error_msg"] + resultObj[:status] = -2 + tmpstatus = -2 + elsif result["results"][0]["status"].to_i == 2 + resultObj[:status] = 2 + tmpstatus = 2 + end - unless student_work.save - resultObj[:status] = 200 - else - student_work.name = params[:title] - student_work.description = params[:src] + if result["status"] == 0 + tmpstatus = 0 + end - if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") - student_work.late_penalty = @homework.late_penalty - else - student_work.late_penalty = 0 - end + unless student_work.save + resultObj[:status] = 200 + else + student_work.name = params[:title] + student_work.description = params[:src] - #姣忔浠庢暟鎹簱鍙栧嚭涓婃鐨勭粨鏋滃姞涓婃湰娆$殑缁撴灉鍐嶅瓨鍏ユ暟鎹簱 - if result["status"].to_i != -2 - result["results"].first['user_wait'] = tUsedtime + if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") + student_work.late_penalty = @homework.late_penalty + else + student_work.late_penalty = 0 + end - if result["results"][0]["status"].to_i == 2 - result["status"] = 2 + #姣忔浠庢暟鎹簱鍙栧嚭涓婃鐨勭粨鏋滃姞涓婃湰娆$殑缁撴灉鍐嶅瓨鍏ユ暟鎹簱 + if result["status"].to_i != -2 + result["results"].first['user_wait'] = tUsedtime + + if result["results"][0]["status"].to_i == 2 + result["status"] = 2 + end + end + + status = result["status"] + if index == 1 + student_work_test = student_work.student_work_tests.build(status: status, + results: [resultObj[:results]],src: params[:src]) + student_work_test.save! + resultObj[:testid] = student_work_test.id + else + #鍏堜粠鏁版嵁搴撳彇鍑簉esult + student_work_test = StudentWorkTest.find(params[:testid]) + results = student_work_test.results + results << resultObj[:results] + student_work_test.results = results + student_work_test.status = (result["status"] != 0 ? result["status"] : student_work_test.status) + student_work_test.save! + status = student_work_test.status + resultObj[:testid] = student_work_test.id + end + + #瓒呮椂鎴栫紪璇戦敊璇垯鐩存帴杩斿洖浜嗗苟瀛樺叆鏁版嵁搴 + if resultObj[:status] == 2 || resultObj[:status] == -2 || index == @homework.homework_tests.size + if status == 0 + resultObj[:status] = 0 + end + student_work.save! + resultObj[:time] = student_work_test.created_at.to_s(:db) + resultObj[:index] = student_work.student_work_tests.count + end + + #灏嗘瘡娆$敤鎴风瓑寰呮椂闂撮兘瀛樿捣鏉ヤ互渚跨鐞嗙晫闈㈡樉绀虹敤 + tEndtime = Time.now + tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000 + logger.debug "program_test_ex user wait time = #{tUsedtime} 姣" + + time_used = 0 + if result["status"].to_i != -2 + #鑷冲皯涓姣 + time_used = result["results"].first['time_used'] == 0 ? 1:result["results"].first['time_used'] + end + #0:绛旀姝g‘ -3http瓒呮椂 -2:缂栬瘧閿欒 -1:绛旀閿欒 2:绋嬪簭杩愯瓒呮椂 + CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>time_used,:wait_time=>tUsedtime,:student_work_id=>student_work.id) end end - - status = result["status"] - if index == 1 - student_work_test = student_work.student_work_tests.build(status: status, - results: [resultObj[:results]],src: params[:src]) - student_work_test.save! - resultObj[:testid] = student_work_test.id - else - #鍏堜粠鏁版嵁搴撳彇鍑簉esult - student_work_test = StudentWorkTest.find(params[:testid]) - results = student_work_test.results - results << resultObj[:results] - student_work_test.results = results - student_work_test.status = (result["status"] != 0 ? result["status"] : student_work_test.status) - student_work_test.save! - status = student_work_test.status - resultObj[:testid] = student_work_test.id - end - - #瓒呮椂鎴栫紪璇戦敊璇垯鐩存帴杩斿洖浜嗗苟瀛樺叆鏁版嵁搴 - if resultObj[:status] == 2 || resultObj[:status] == -2 || index == @homework.homework_tests.size - if status == 0 - resultObj[:status] = 0 - end - student_work.save! - resultObj[:time] = student_work_test.created_at.to_s(:db) - resultObj[:index] = student_work.student_work_tests.count - end - - #灏嗘瘡娆$敤鎴风瓑寰呮椂闂撮兘瀛樿捣鏉ヤ互渚跨鐞嗙晫闈㈡樉绀虹敤 - tEndtime = Time.now - tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000 - logger.debug "program_test_ex user wait time = #{tUsedtime} 姣" - - time_used = 0 - if result["status"].to_i != -2 - #鑷冲皯涓姣 - time_used = result["results"].first['time_used'] == 0 ? 1:result["results"].first['time_used'] - end - #0:绛旀姝g‘ -3http瓒呮椂 -2:缂栬瘧閿欒 -1:绛旀閿欒 2:绋嬪簭杩愯瓒呮椂 - CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>time_used,:wait_time=>tUsedtime,:student_work_id=>student_work.id) - - #娓叉煋杩斿洖缁撴灉 - render :json => resultObj + rescue + #-5 program_test_ex 鍑芥暟鍑洪敊 + logger.debug "program_test_error 2" + resultObj[:status] = -5 + tmpstatus = -5 + CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>0,:wait_time=>0,:student_work_id=>student_work.id) end + #娓叉煋杩斿洖缁撴灉 + render :json => resultObj end end end @@ -360,6 +376,7 @@ class StudentWorkController < ApplicationController ################################################################################################################## @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group] @homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc") + @all_homework_commons = @course.homework_commons.order("created_at desc") @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? @is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #鏄笉鏄尶璇 @show_all = false @@ -816,7 +833,7 @@ class StudentWorkController < ApplicationController stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a") @work.student_score = stu_score.first.score.try(:round, 2).to_f end - @homework.update_attributes(:updated_at => Time.now) + @homework.update_column('updated_at', Time.now) update_course_activity(@homework.class,@homework.id) update_user_activity(@homework.class,@homework.id) update_org_activity(@homework.class,@homework.id) diff --git a/app/controllers/sub_document_comments_controller.rb b/app/controllers/sub_document_comments_controller.rb index 767e1ba29..cdf153a20 100644 --- a/app/controllers/sub_document_comments_controller.rb +++ b/app/controllers/sub_document_comments_controller.rb @@ -125,6 +125,8 @@ class SubDocumentCommentsController < ApplicationController def destroy @sub_document_comment = SubDocumentComment.find(params[:id]) @sub_document_comment.destroy + @sub_domain = @sub_document_comment.sub_domain + @org_subfield = @sub_domain.org_subfield rescue ActiveRecord::RecordNotFound respond_to do |format| # format.html{ diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1b4fcd499..2c4355180 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -645,7 +645,7 @@ class UsersController < ApplicationController new_homework.homework_detail_programing.save if new_homework.homework_detail_programing new_homework.homework_detail_group.save if new_homework.homework_detail_group end - homework.update_attribute(:quotes, homework.quotes+1) + homework.update_column(:quotes, homework.quotes+1) end @homework = homework respond_to do |format| @@ -918,7 +918,7 @@ class UsersController < ApplicationController student_work.save send_message_to_teacher(student_work) - homework.update_attributes(:updated_at => Time.now) + homework.update_column(:updated_at, Time.now) update_course_activity(homework.class,homework.id) update_user_activity(homework.class,homework.id) update_org_activity(homework.class,homework.id) @@ -1006,7 +1006,7 @@ class UsersController < ApplicationController homework_detail_group.save if homework_detail_group if params[:quotes] && !params[:quotes].blank? quotes_homework = HomeworkCommon.find params[:quotes].to_i - quotes_homework.update_attribute(:quotes, quotes_homework.quotes+1) + quotes_homework.update_column(:quotes, quotes_homework.quotes+1) end if params[:is_in_course] == "1" redirect_to homework_common_index_path(:course => homework.course_id) @@ -1429,7 +1429,7 @@ class UsersController < ApplicationController user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" user_course_ids = (@user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')" - project_types = "('Message','Issue','ProjectCreateInfo')" + project_types = "('Message','Issue','Project')" principal_types = "JournalsForMessage" if params[:type].present? case params[:type] @@ -2705,7 +2705,7 @@ class UsersController < ApplicationController # 鑾峰彇鍏叡璧勬簮鎼滅储 def get_public_resources_search user_course_ids, user_project_ids, order, score, search - attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)" ,:p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + attachments = Attachment.where("is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") end # 鑾峰彇鎴戠殑璧勬簮 @@ -2816,7 +2816,7 @@ class UsersController < ApplicationController # 鑾峰彇鎴戠殑鐢ㄦ埛绫诲瀷璧勬簮 def get_principal_resources_public order, score - attchments = Attachment.where("container_type = 'Principal'and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("container_type = 'Principal' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") end # 鑾峰彇鎴戠殑鐢ㄦ埛绫诲瀷璧勬簮 diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 30f56a1d9..39be9cef3 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -211,7 +211,7 @@ class WechatsController < ActionController::Base user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")" course_types = "('Message','News','HomeworkCommon','Poll','Course')" - project_types = "('Message','Issue','ProjectCreateInfo')" + project_types = "('Message','Issue','Project')" principal_types = "JournalsForMessage" blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1d43ff69a..4d92808d4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -49,6 +49,30 @@ module ApplicationHelper return result end + # 鍒ゆ柇鏌愪釜璧勬簮鏄惁鍙互鐢宠 + def attach_show_allow attach_id + attachment = Attachment.find(attach_id) + case attachment.container_type + when "Project" + User.current.member_of?(attachment.container) ? true : false + when "Course" + User.current.member_of_course?(attachment.container) ? true : false + when "OrgSubfield" + User.current.member_of_org?(attachment.container.organization) ? true : false + when "Principal" + User.current.id == attachment.author_id ? true : false + end + end + + # 鍒ゆ柇鏌愪釜绉佹湁璧勬簮鏄惁鍙互鍙戦佷笅杞芥潈闄 + # 缁撴灉涓簍rue涓嶈兘涓嬭浇锛宖alse鍙互涓嬭浇 + def private_attachment_allow attachment_id + attach = Attachment.find(attachment_id) + # 鏉′欢鍙栧惁锛宺esult缁撴灉涓簍rue鍒欎笉鑳戒笅杞 + result = attach.is_public == 0 && attach.author != User.current && !attach.get_apply_resource_status(attach.id, User.current.id) && !attach_show_allow(attach) + return result + end + # Time 2015-03-24 15:27:29 # Author lizanle # Description 浠庣‖鐩樹笂鍒犻櫎瀵瑰簲鐨勮祫婧愭枃浠 @@ -2094,20 +2118,20 @@ module ApplicationHelper candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1) elsif attachment.container.is_a?(Project) project = attachment.container - candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1) + candown = User.current.member_of?(project) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2 elsif (attachment.container.has_attribute?(:board) || attachment.container.has_attribute?(:board_id)) && attachment.container.board && attachment.container.board.project project = attachment.container.board.project candown = User.current.member_of?(project) || (project.is_public && attachment.is_public == 1) elsif (attachment.container.has_attribute?(:course) ||attachment.container.has_attribute?(:course_id) ) && attachment.container.course course = attachment.container.course - candown = User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) + candown = User.current.member_of_course?(course) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2 elsif attachment.container.is_a?(Course) course = attachment.container - candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) + candown= User.current.member_of_course?(course) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2 elsif attachment.container.is_a?(OrgSubfield) org = attachment.container.organization - candown = User.current.member_of_org?(org) || (org.is_public && attachment.is_public == 1) + candown = User.current.member_of_org?(org) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2 elsif attachment.container.is_a?(OrgDocumentComment) org = attachment.container.organization candown = User.current.member_of_org?(org) || (org.is_public && attachment.is_public == 1) @@ -3237,6 +3261,7 @@ def strip_html(text,len=0,endss="...") ss = "" if text.length>0 ss=text.gsub(/<\/?.*?>/, '').strip + ss = ss.gsub(/ /, ' ') if len > 0 && ss.length > len ss = ss[0, len] + endss @@ -3247,3 +3272,14 @@ def strip_html(text,len=0,endss="...") end return ss end + +def get_hw_index(hw,is_teacher) + if is_teacher + homeworks = hw.course.homework_commons.order("created_at asc") + else + homeworks = hw.course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at asc") + end + hw_ids = homeworks.map{|hw| hw.id} if !homeworks.empty? + index = hw_ids.index(hw.id) + return index +end diff --git a/app/models/attachment.rb b/app/models/attachment.rb index b7ec264fd..8f9ee2d85 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -142,7 +142,8 @@ class Attachment < ActiveRecord::Base end def get_apply_resource_status attachment_id, author_id - ApplyResource.where("attachment_id =? and apply_user_id =?", attachment_id, author_id).first.try(:status) + status = ApplyResource.where("attachment_id =? and user_id =?", attachment_id, author_id).first.try(:status) + status == 2 ? true :false end # add by nwb diff --git a/app/models/course_activity.rb b/app/models/course_activity.rb index 96ec6e355..2aae45d0a 100644 --- a/app/models/course_activity.rb +++ b/app/models/course_activity.rb @@ -5,8 +5,7 @@ class CourseActivity < ActiveRecord::Base belongs_to :course belongs_to :user has_many :user_acts, :class_name => 'UserAcivity',:as =>:act - after_save :add_user_activity, :add_org_activity - after_create :add_course_lead + after_create :add_course_lead,:add_user_activity, :add_org_activity before_destroy :destroy_user_activity, :destroy_org_activity #鍦ㄤ釜浜哄姩鎬侀噷闈㈠鍔犲綋鍓嶅姩鎬 diff --git a/app/models/forge_activity.rb b/app/models/forge_activity.rb index c044392a0..44b13b315 100644 --- a/app/models/forge_activity.rb +++ b/app/models/forge_activity.rb @@ -20,7 +20,7 @@ class ForgeActivity < ActiveRecord::Base validates :forge_act_id,presence: true validates :forge_act_type, presence: true has_many :user_acts, :class_name => 'UserAcivity',:as =>:act - after_save :add_user_activity, :add_org_activity + after_create :add_user_activity, :add_org_activity before_destroy :destroy_user_activity, :destroy_org_activity #鍦ㄤ釜浜哄姩鎬侀噷闈㈠鍔犲綋鍓嶅姩鎬 diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index f11a48a80..e4426e78f 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -29,8 +29,8 @@ class HomeworkCommon < ActiveRecord::Base :description => :description, :author => :author, :url => Proc.new {|o| {:controller => 'student_work', :action => 'index', :homework => o.id}} - after_create :act_as_activity, :send_mail - after_update :update_activity + after_create :act_as_activity, :send_mail,:act_as_course_message + after_update :update_activity, :wechat_message after_save :act_as_course_activity after_destroy :delete_kindeditor_assets @@ -59,12 +59,12 @@ class HomeworkCommon < ActiveRecord::Base else self.course.members.each do |m| # if m.user_id != self.user_id - self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) - #count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count - #if count == 0 - # ws = WechatService.new - # ws.homework_template(m.user_id, "homework", self.id, "#{l(:label_new_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59") - #end + #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) + count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count + if count == 0 + ws = WechatService.new + ws.homework_template(m.user_id, "homework", self.id, "#{l(:label_new_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59") + end # end end end diff --git a/app/models/issue.rb b/app/models/issue.rb index d5d148117..b5e87feea 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -164,7 +164,20 @@ class Issue < ActiveRecord::Base count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Project' and shield_id=#{self.project_id}").count if m.user_id != self.author_id && count == 0 ws = WechatService.new - content = strip_html self.project.name + " 鏈夋柊缂洪櫡浜嗭細" + self.subject.html_safe, 200 + str = " 鏈夋柊缂洪櫡浜嗭細 " + case self.tracker_id + when 1 + str = " 鏈夋柊缂洪櫡浜嗭細 " + when 2 + str = " 鏈夋柊鍔熻兘浜嗭細 " + when 3 + str = " 鏈夋柊鏀寔浜嗭細 " + when 4 + str = " 鏈夋柊浠诲姟浜嗭細 " + when 5 + str = " 鏈夋柊鍛ㄦ姤浜嗭細 " + end + content = strip_html self.project.name + str + self.subject.html_safe, 200 ws.message_update_template m.user_id, "issues", self.id, "#{l(:label_new_issue_template)}", content, format_time(self.created_on) end end diff --git a/app/models/journal.rb b/app/models/journal.rb index 02086fa62..eeaa17dd6 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -239,8 +239,10 @@ class Journal < ActiveRecord::Base #缂洪櫡鍥炲寰俊妯℃澘娑堟伅 def issue_wechat_message - ws = WechatService.new - content = strip_html self.notes.html_safe, 200 - ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content + if !self.notes.nil? && self.notes.gsub(' ','') != '' + ws = WechatService.new + content = strip_html self.notes.html_safe, 200 + ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content + end end end diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 4b5ac227f..d0113744c 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -259,14 +259,25 @@ class JournalsForMessage < ActiveRecord::Base if self.m_parent_id.nil? if self.user_id != self.jour.user_id self.course_messages << CourseMessage.new(:user_id => self.jour.user_id,:course_id => self.jour.course.id, :viewed => false) + count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count + if count == 0 + ws = WechatService.new + #content = truncate(strip_tags(self.notes.to_s), length: 200) + content = strip_html self.notes.html_safe, 200 + ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content + end + end + else + if self.user_id != self.parent.user_id + self.course_messages << CourseMessage.new(:user_id => self.parent.user_id,:course_id => self.jour.course.id, :viewed => false) + count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.parent.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count + if count == 0 + ws = WechatService.new + #content = truncate(strip_tags(self.notes.to_s), length: 200) + content = strip_html self.notes.html_safe, 200 + ws.comment_template self.parent.user_id, "homework", self.jour_id, "#{l(:label_new_second_comment_template)}", self.user.try(:realname), format_time(self.created_on), content + end end - end - count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count - if count == 0 - ws = WechatService.new - #content = truncate(strip_tags(self.notes.to_s), length: 200) - content = strip_html self.notes.html_safe, 200 - ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content end end end diff --git a/app/models/message.rb b/app/models/message.rb index 7bfb9d80e..fdc3c6bdc 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -274,7 +274,7 @@ class Message < ActiveRecord::Base else # 鍥炲笘 parent_author_id = Message.find(self.parent_id).author_id if parent_author_id != self.author_id # 鍙拡瀵逛富璐村洖澶嶏紝鍥炲鑷繁鐨勫笘瀛愪笉鍙戞秷鎭 - #self.course_messages << CourseMessage.new(:user_id => parent_author_id, :course_id => self.board.course_id, :viewed => false) + self.course_messages << CourseMessage.new(:user_id => parent_author_id, :course_id => self.board.course_id, :viewed => false) count = ShieldWechatMessage.where("container_type='User' and container_id=#{parent_author_id} and shield_type='Course' and shield_id=#{self.board.course_id}").count if count == 0 content = strip_html self.content.html_safe, 200 @@ -297,7 +297,7 @@ class Message < ActiveRecord::Base else # 鍥炲笘 parent_author_id = Message.find(self.parent_id).author_id if parent_author_id != self.author_id # 鍙拡瀵逛富璐村洖澶嶏紝鍥炲鑷繁鐨勫笘瀛愪笉鍙戞秷鎭 - #self.forge_messages << ForgeMessage.new(:user_id => parent_author_id, :project_id => self.board.project_id, :viewed => false) + self.forge_messages << ForgeMessage.new(:user_id => parent_author_id, :project_id => self.board.project_id, :viewed => false) count = ShieldWechatMessage.where("container_type='User' and container_id=#{parent_author_id} and shield_type='Project' and shield_id=#{self.board.project_id}").count if count == 0 content = strip_html self.content.html_safe, 200 diff --git a/app/models/news.rb b/app/models/news.rb index f0457dc81..a411ccaca 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 + after_create :act_as_activity,:act_as_forge_activity, :act_as_course_activity, :add_author_as_watcher, :send_mail, :add_news_count, :act_as_student_score, :act_as_system_message after_update :update_activity after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities, :down_course_score @@ -169,12 +169,12 @@ class News < ActiveRecord::Base if self.course self.course.members.each do |m| if m.user_id != self.author_id - self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) + #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count if count == 0 ws = WechatService.new content = strip_html self.author.try(:realname) + " 鍙戝竷浜嗛氱煡锛" + self.title.html_safe, 200 - ws.message_update_template m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.author.try(:realname) + " 鍙戝竷浜嗛氱煡锛" + content, format_time(self.created_on) + ws.message_update_template m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", content, format_time(self.created_on) end end end diff --git a/app/models/sso.rb b/app/models/sso.rb index a58b5e442..c987ff933 100644 --- a/app/models/sso.rb +++ b/app/models/sso.rb @@ -17,7 +17,7 @@ class Sso < ActiveRecord::Base sso.openid = opt["openid"] sso.email = opt["email"] sso.password = opt["password"] - sso.school = Base64.decode64(opt["school"]).force_encoding('utf-8') + sso.school = opt["school"] sso.sex = opt["sex"] diff --git a/app/views/admin/code_work_tests.html.erb b/app/views/admin/code_work_tests.html.erb index 64c3a41e1..2013bd322 100644 --- a/app/views/admin/code_work_tests.html.erb +++ b/app/views/admin/code_work_tests.html.erb @@ -24,8 +24,8 @@ 娴嬭瘯瀹屾垚鏃堕棿 - - 绛旈鐘舵 + + 绛旈鐘舵 鑰楁椂 @@ -76,6 +76,10 @@ <%= "浠g爜瓒呮椂" %> <% elsif test.status == -3 %> <%= "璇锋眰瓒呮椂" %> + <% elsif test.status == -4 %> + <%= "judge浠g爜鍑洪敊!" %> + <% elsif test.status == -5 %> + <%= "trustie浠g爜鍑洪敊!" %> <% else %> <%= "绛旈閿欒" %> <% end %> diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index de7f1647d..d3763abf3 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -141,6 +141,7 @@
@@ -215,5 +216,6 @@ var postContent = $("#message_description_<%= @article.id %>").html(); postContent = postContent.replace(/ /g," "); $("#message_description_<%= @article.id %>").html(postContent); + autoUrl('message_description_<%= @article.id %>'); }); diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index f0b082860..dd818fe72 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -43,8 +43,8 @@ <% count=activity.children.count%> <% end %>
  • - 鍙戝笘鏃堕棿锛<%= format_time(activity.created_on) %> - 鏇存柊鏃堕棿锛<%= format_time(activity.updated_on) %> + 鍙戝竷锛<%= format_time(activity.created_on) %> + 鏇存柊锛<%= format_time(activity.updated_on) %>

    <%= count>0 ? "#{count}" :"0" %> 鍥炲 diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index c7e4a7428..1050a59b9 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -36,7 +36,7 @@

    鍙栨秷 - 鐣欒█ + 鐣欒█ <% end %>
  • <% end %> @@ -55,9 +55,6 @@
    @@ -214,5 +215,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @article.id %>'); }); \ No newline at end of file diff --git a/app/views/exercise/_student_exercise.html.erb b/app/views/exercise/_student_exercise.html.erb index d7a1b85bb..f9fd114dd 100644 --- a/app/views/exercise/_student_exercise.html.erb +++ b/app/views/exercise/_student_exercise.html.erb @@ -22,60 +22,6 @@
    - <%= render :partial => "student_table"%> + <%= render :partial => "student_table" %>
    -
    - -<% @exercise_users_list.each do |exercise|%> - - - -
    -<% end%> \ No newline at end of file +
    \ No newline at end of file diff --git a/app/views/exercise/_student_exercise_archive.html.erb b/app/views/exercise/_student_exercise_archive.html.erb new file mode 100644 index 000000000..abc604b73 --- /dev/null +++ b/app/views/exercise/_student_exercise_archive.html.erb @@ -0,0 +1,81 @@ +
    + + 娴嬮獙 + + (<%= @exercise_count%>浜哄凡浜) + + <% if !@is_teacher && @exercise_users_list.empty?%> + 鎮ㄥ皻鏈彁浜 + <% elsif !@is_teacher && !@exercise_users_list.empty?%> + 鎮ㄥ凡鎻愪氦 + <% end %> + + <%#if @is_teacher || @exercise.exercise_status == 3%> + + <%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %> + <%# end%> + +
    +
    + +
    + <%= render :partial => "student_table"%> +
    +
    + +<% @exercise_users_list.each do |exercise|%> + + + +
    +<% end%> \ No newline at end of file diff --git a/app/views/exercise/_student_table.html.erb b/app/views/exercise/_student_table.html.erb index 8957c5048..3022b83a6 100644 --- a/app/views/exercise/_student_table.html.erb +++ b/app/views/exercise/_student_table.html.erb @@ -1,23 +1,71 @@ -
    -
    +
    <%# 濡傛灉鏈夊巻鍙茬増鏈垯鎻愪緵鍘嗗彶鐗堟湰涓嬭浇 %> <% if file.attachment_histories.count == 0 %> <%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'), diff --git a/app/views/files/_project_list.html.erb b/app/views/files/_project_list.html.erb index 2ee726d77..831dc0e68 100644 --- a/app/views/files/_project_list.html.erb +++ b/app/views/files/_project_list.html.erb @@ -7,7 +7,7 @@ <%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
    -
    +
    <%# 濡傛灉鏈夊巻鍙茬増鏈垯鎻愪緵鍘嗗彶鐗堟湰涓嬭浇 %> <% if file.attachment_histories.count == 0 %> <%= link_to truncate(file.filename,length: 35, omission: '...'), diff --git a/app/views/files/_resource_detail.html.erb b/app/views/files/_resource_detail.html.erb index 20ffb1e50..2a03723ca 100644 --- a/app/views/files/_resource_detail.html.erb +++ b/app/views/files/_resource_detail.html.erb @@ -5,7 +5,7 @@ <%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
    -
    +
    <%# 濡傛灉鏈夊巻鍙茬増鏈垯鎻愪緵鍘嗗彶鐗堟湰涓嬭浇 %> <% if file.attachment_histories.count == 0 %> <%= link_to truncate(file.filename,length: 35, omission: '...'), diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb index 08c030f90..ed90453ac 100644 --- a/app/views/forums/_show_topics.html.erb +++ b/app/views/forums/_show_topics.html.erb @@ -1,6 +1,12 @@
    <% if memos.any? %> <% memos.each do |topic| %> +
    @@ -16,7 +22,7 @@ <%= get_praise_num(topic)%>
    -
    <%= topic.content.html_safe%> +
    <%= topic.content.html_safe%>
    <% author = topic.last_reply.try(:author)%> diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index e34cf0736..29cff8933 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -73,6 +73,12 @@ <% end%> <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homeworks,:page => 0,:is_in_course => 1,:course_id => @course.id} %> +
    +
      + <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> +
    +
    +
    diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb index 92021f728..03c420c99 100644 --- a/app/views/issues/_detail.html.erb +++ b/app/views/issues/_detail.html.erb @@ -28,7 +28,7 @@ <%= render :partial => 'action_menu' %>
    <% if @issue.description? || @issue.attachments.any? -%> -
    +
    <% if @issue.description? %> <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> <%= textAreailizable @issue, :description, :attachments => @issue.attachments %> @@ -43,4 +43,11 @@ <%= render :partial => 'issues/attributes_show' %>
    -
    \ No newline at end of file +
    + + \ No newline at end of file diff --git a/app/views/issues/_issue_replies.html.erb b/app/views/issues/_issue_replies.html.erb index 4c8dfa1d9..197cd9c02 100644 --- a/app/views/issues/_issue_replies.html.erb +++ b/app/views/issues/_issue_replies.html.erb @@ -3,6 +3,7 @@ <% replies_all_i=replies_all_i + 1 %> @@ -11,7 +12,7 @@ <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if reply.try(:user).try(:realname) == ' ' %> <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 83b90dc93..3524de0c8 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -94,12 +94,12 @@ <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
    -
    <%= reply.author.name%><%= format_date(reply.created_at) %>
    +
    <%= reply.author.name%><%= format_date(reply.created_at) %>
    <%= reply.content.html_safe%>
    @@ -147,6 +148,7 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('activity_description_<%= @memo.id %>'); description_show_hide(<%= @memo.id %>); }); \ No newline at end of file diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 33c9d7f8d..443440455 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -109,6 +109,7 @@
    @@ -188,5 +189,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @topic.id %>'); }); diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb index 4d5af61dd..145afcfd7 100644 --- a/app/views/messages/_org_subfield_show.html.erb +++ b/app/views/messages/_org_subfield_show.html.erb @@ -138,6 +138,7 @@
    @@ -210,5 +211,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @topic.id %>'); }); diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index 10046bce2..35b3f8a3c 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -165,6 +165,7 @@
    @@ -245,5 +246,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @topic.id %>'); }); diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 46346eb71..5908c7593 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -115,6 +115,7 @@
    @@ -210,5 +211,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @news.id %>'); }); diff --git a/app/views/news/_organization_show.html.erb b/app/views/news/_organization_show.html.erb index 640854164..7eecf43ab 100644 --- a/app/views/news/_organization_show.html.erb +++ b/app/views/news/_organization_show.html.erb @@ -97,6 +97,7 @@
    @@ -185,5 +186,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @news.id %>'); }); diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 6b91c98ed..6b3824222 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -107,6 +107,7 @@
    @@ -195,5 +196,6 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('message_description_<%= @news.id %>'); }); diff --git a/app/views/org_document_comments/destroy.js.erb b/app/views/org_document_comments/destroy.js.erb index 787bd3185..394078db1 100644 --- a/app/views/org_document_comments/destroy.js.erb +++ b/app/views/org_document_comments/destroy.js.erb @@ -1,6 +1,6 @@ //location.reload(); <% if params[:detail_page] %> - window.location.href = '<%= organization_org_document_comments_path(:organization_id => @org_document_comment.root.organization_id)%>'; + window.location.href = '<%= organization_path(params[:organization_id],:org_subfield_id => @org_sub_id )%>'; <% else %> window.location.reload(); <% end %> \ No newline at end of file diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index f5b186197..e2967a9ae 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -84,6 +84,7 @@ <% user = User.find(reply.creator_id) %> @@ -158,6 +159,7 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('intro_content_<%= @document.id %>'); }); function expand_reply(container, btnid) { var target = $(container); diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index a3e62fd16..2c135cd2e 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -46,7 +46,7 @@
    <% end %> - <% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %> + <% if act.org_act_type == 'OrgDocumentComment' %> <%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %> <% end %> <% end %> @@ -56,7 +56,7 @@ <%= render :partial => 'organizations/org_project_issue', :locals => {:activity => Issue.find(act.org_act_id),:user_activity_id =>act.id} %> <% when 'Message' %> <%= render :partial => 'organizations/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %> - <% when 'ProjectCreateInfo'%> + <% when 'Project'%> <%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %> <% end %> <% end %> diff --git a/app/views/organizations/_org_course_create.html.erb b/app/views/organizations/_org_course_create.html.erb index a09246dc7..97bc0e353 100644 --- a/app/views/organizations/_org_course_create.html.erb +++ b/app/views/organizations/_org_course_create.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
    -
    +
    <% if activity.try(:teacher).try(:realname) == ' ' %> <%= link_to activity.try(:teacher), user_url_in_org(activity.tea_id), :class => "newsBlue mr15" %> <% else %> @@ -39,4 +39,4 @@ $(function(){ user_card_show_hide(); }); - \ No newline at end of file + diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index b4ca46959..d3fe36fe3 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -6,7 +6,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
    -
    +
    <% if activity.try(:user).try(:realname) == ' ' %> <%= link_to activity.try(:user), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %> <% else %> @@ -210,9 +210,9 @@
    <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> - <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_url_in_org(project.id),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"椤圭洰澶村儚" %> + <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_url_in_org(project.id),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"椤圭洰澶村儚" %> <% else %> - <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"椤圭洰澶村儚") %> + <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"椤圭洰澶村儚") %> <% end %> <% com_time = project.project_score.commit_time %> <% time=project.updated_on %> @@ -315,6 +315,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/organizations/_org_course_message.html.erb b/app/views/organizations/_org_course_message.html.erb index 56dafed08..e68745f7a 100644 --- a/app/views/organizations/_org_course_message.html.erb +++ b/app/views/organizations/_org_course_message.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -100,6 +100,7 @@ <% replies_all_i=replies_all_i+1 %> @@ -108,7 +109,7 @@ <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if reply.try(:author).try(:realname) == ' ' %> <%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/organizations/_org_course_news.html.erb b/app/views/organizations/_org_course_news.html.erb index a6183e891..acf0f0377 100644 --- a/app/views/organizations/_org_course_news.html.erb +++ b/app/views/organizations/_org_course_news.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if @ctivity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -69,6 +69,7 @@ <% replies_all_i = replies_all_i + 1 %> @@ -77,7 +78,7 @@ <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if comment.try(:author).try(:realname) == ' ' %> <%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/organizations/_org_course_poll.html.erb b/app/views/organizations/_org_course_poll.html.erb index cb390f7f5..2958df0ca 100644 --- a/app/views/organizations/_org_course_poll.html.erb +++ b/app/views/organizations/_org_course_poll.html.erb @@ -9,7 +9,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
    -
    +
    <% if activity.try(:user).try(:realname) == ' ' %> <%= link_to activity.try(:user), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %> <% else %> diff --git a/app/views/organizations/_org_project_activities.html.erb b/app/views/organizations/_org_project_activities.html.erb index b46996661..d27e690c6 100644 --- a/app/views/organizations/_org_project_activities.html.erb +++ b/app/views/organizations/_org_project_activities.html.erb @@ -6,7 +6,7 @@ <%= render :partial => 'organizations/org_project_issue', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %> <% when 'Message' %> <%= render :partial => 'organizations/project_message', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %> - <% when 'ProjectCreateInfo'%> + <% when 'Project'%> <%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %> <% end %> <% end %> diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index 98c1e2df3..9ca10c91d 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -80,6 +80,7 @@ <% replies_all_i=replies_all_i + 1 %> @@ -88,7 +89,7 @@ <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_url_in_org(reply.user_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if reply.try(:user).try(:realname) == ' ' %> <%= link_to reply.try(:user), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index fc6cc6ee0..61bc5bc7f 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -105,6 +105,7 @@ <% replies_all_i=replies_all_i+1 %> @@ -113,7 +114,7 @@ <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if reply.try(:author).try(:realname) == ' ' %> <%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/organizations/_org_subfield_news.html.erb b/app/views/organizations/_org_subfield_news.html.erb index daa81e96c..5d6c38542 100644 --- a/app/views/organizations/_org_subfield_news.html.erb +++ b/app/views/organizations/_org_subfield_news.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -89,6 +89,7 @@ <% replies_all_i = replies_all_i + 1 %> @@ -97,7 +98,7 @@ <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if comment.try(:author).try(:realname) == ' ' %> <%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/organizations/_project_create.html.erb b/app/views/organizations/_project_create.html.erb index ef59d154e..9a4f00a9a 100644 --- a/app/views/organizations/_project_create.html.erb +++ b/app/views/organizations/_project_create.html.erb @@ -7,7 +7,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
    -
    +
    <% if user.try(:realname) == ' ' %> <%= link_to user, user_url_in_org(user.id), :class => "newsBlue mr15" %> <% else %> @@ -41,4 +41,4 @@ $(function(){ user_card_show_hide(); }); - \ No newline at end of file + diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index 26cf3b318..e1b000c70 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -79,6 +79,7 @@ <% replies_all_i=replies_all_i+1 %> @@ -87,7 +88,7 @@ <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if reply.try(:author).try(:realname) == ' ' %> <%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/organizations/_show_home_page.html.erb b/app/views/organizations/_show_home_page.html.erb index 63eb1808b..ecb5ebb25 100644 --- a/app/views/organizations/_show_home_page.html.erb +++ b/app/views/organizations/_show_home_page.html.erb @@ -59,6 +59,7 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('intro_content_<%= document.id %>'); function expand_reply(container, btnid) { var target = $(container); var btn = $(btnid); diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 6012dd0d4..e8f531206 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -88,6 +88,12 @@
      <% reply_id = 0 %> <% comments_for_doc.each do |comment| %> + <% reply_id += 1 %>
    • <%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "鐢ㄦ埛澶村儚"), user_url_in_org(comment.creator_id) %>
      @@ -104,7 +110,7 @@
    <% unless comment.content.blank? %> -
    <%= comment.content.html_safe %>
    +
    <%= comment.content.html_safe %>
    <% end %>
    diff --git a/app/views/projects/_attachment_acts.html.erb b/app/views/projects/_attachment_acts.html.erb index de0820bff..0ecfa9be7 100644 --- a/app/views/projects/_attachment_acts.html.erb +++ b/app/views/projects/_attachment_acts.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> diff --git a/app/views/projects/_project_create.html.erb b/app/views/projects/_project_create.html.erb index bd118418d..2e7a919d1 100644 --- a/app/views/projects/_project_create.html.erb +++ b/app/views/projects/_project_create.html.erb @@ -7,7 +7,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
    -
    +
    <% if user.try(:realname) == ' ' %> <%= link_to user, user_path(user), :class => "newsBlue mr15" %> <% else %> @@ -41,4 +41,4 @@ $(function(){ user_card_show_hide(); }); - \ No newline at end of file + diff --git a/app/views/projects/_project_jours.html.erb b/app/views/projects/_project_jours.html.erb index 6095bac96..eacc2a152 100644 --- a/app/views/projects/_project_jours.html.erb +++ b/app/views/projects/_project_jours.html.erb @@ -80,6 +80,9 @@ if(params.content.isEmpty()){ params.contentmsg.html('鍐呭涓嶈兘涓虹┖'); params.contentmsg.css({color:'#ff0000'}); + params.submit_btn.one('click', function(){ + params.form.submit(); + }); }else{ params.contentmsg.html('濉啓姝g‘'); params.contentmsg.css({color:'#008000'}); @@ -124,7 +127,9 @@ issubmit:true, content:params.editor, contentmsg:params.contentmsg, - textarea:params.textarea + textarea:params.textarea, + submit_btn:params.submit_btn, + form:params.form }); if(is_checked){ if(flag){ @@ -161,13 +166,15 @@ params.contentmsg = $("p[nhname='contentmsg']",params.div_form); params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form); - if(params.textarea.data('init') == undefined){ - params.editor = init_editor(params); - init_form(params); - params.cancel_btn.click(function(){ - nh_reset_form(params); - }); - } + params.submit_btn = $("input[nhname='submit_btn']",params.div_form); + params.editor = init_editor(params); + init_form(params); + params.submit_btn.one('click', function () { + params.form.submit(); + }); + params.cancel_btn.click(function(){ + nh_reset_form(params); + }); params.cancel_btn.click(); toggleAndSettingWordsVal(params.div_form, params.textarea); setTimeout(function(){ diff --git a/app/views/projects/_project_news.html.erb b/app/views/projects/_project_news.html.erb index 8756ff26f..6d97b252d 100644 --- a/app/views/projects/_project_news.html.erb +++ b/app/views/projects/_project_news.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -69,6 +69,7 @@ <% replies_all_i = replies_all_i + 1 %> @@ -77,7 +78,7 @@ <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if comment.try(:author).try(:realname) == ' ' %> <%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> <% else %> @@ -125,4 +126,4 @@ $(function(){ user_card_show_hide(); }); - \ No newline at end of file + diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb index 257fcb94a..064444f04 100644 --- a/app/views/student_work/_evaluation_title.html.erb +++ b/app/views/student_work/_evaluation_title.html.erb @@ -1,27 +1,39 @@ -
      -
    • 搴忓彿
    • -
    •  
    • -
    • - 浣滃搧鍚嶇О -
    • + + + + + <% if @homework.homework_type != 3 %> -
    • 濮撳悕
    • -
    • 瀛﹀彿
    • + + <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> -
    • 鍏宠仈椤圭洰
    • + <% end %> - -
    • - 鏃堕棿 -
    • - - <% if @homework.homework_type == 2%> -
    • - 绯荤粺 -
    • + + <% if @homework.homework_type == 2%> + + <% end%> + + + <% @stundet_works.each_with_index do |student_work, i|%> + <%= render :partial => "evaluation_work", :locals => {:student_work => student_work, :index => i}%> + + + <% end%> - -
    • - 鎴戠殑璇勫垎 -
    • - \ No newline at end of file +
      搴忓彿 浣滃搧鍚嶇О + 濮撳悕 + + 瀛﹀彿 + + 鍏宠仈椤圭洰 + + 鏃堕棿 + + 绯荤粺 + + 鎴戠殑璇勫垎 +
      +
      +
      +
      \ No newline at end of file diff --git a/app/views/student_work/_evaluation_title_archive.html.erb b/app/views/student_work/_evaluation_title_archive.html.erb new file mode 100644 index 000000000..01bab5264 --- /dev/null +++ b/app/views/student_work/_evaluation_title_archive.html.erb @@ -0,0 +1,27 @@ +
        +
      • 搴忓彿
      • +
      •  
      • +
      • + 浣滃搧鍚嶇О +
      • + <% if @homework.homework_type != 3 %> +
      • 濮撳悕
      • +
      • 瀛﹀彿
      • + <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> +
      • 鍏宠仈椤圭洰
      • + <% end %> + +
      • + 鏃堕棿 +
      • + + <% if @homework.homework_type == 2%> +
      • + 绯荤粺 +
      • + <% end%> + +
      • + 鎴戠殑璇勫垎 +
      • +
      \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index 0721c9ff5..98e9f1f64 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -1,73 +1,74 @@ -
        -
      • 搴忓彿
      • -
      •  
      • -
      • - 浣滃搧鍚嶇О -
      • + + + + + <% 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%> - <% end%> -
      • -
      • - - <%= link_to "瀛﹀彿",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml30" ,:remote => true%> - <% if @show_all && @order == "student_id"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%> - <% end%> -
      • + + <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> -
      • - 鍏宠仈椤圭洰 -
      • + <% 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%> - <% if @show_all && @order == "created_at"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> +
      • + + + <% if @homework.homework_type == 2%> + <% end%> - - -
      • - <%= link_to "鏁欏笀",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%> - <% if @show_all && @order == "teacher_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%> - <% end%> -
      • - -
      • - <%= link_to "鏁欒緟",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> - <% if @show_all && @order == "teaching_asistant_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> - <% end%> -
      • - - <% if @homework.homework_type == 2%> -
      • - <%= link_to "绯荤粺",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> - <% if @show_all && @order == "system_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> - <% end%> -
      • + <% if @homework.anonymous_comment == 0%> + + <% end %> + + + <% @stundet_works.each_with_index do |student_work, i|%> + <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i}%> + + + <% end%> - - <% if @homework.anonymous_comment == 0%> -
      • - <%= link_to "鍖胯瘎",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> - <% if @show_all && @order == "student_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> - <% end%> -
      • - <% end %> - -
      • - <%= link_to "鎴愮哗",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> - <% if @show_all && @order == "score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> - <% end%> -
      • - \ No newline at end of file +
        搴忓彿 浣滃搧鍚嶇О + <%= link_to "濮撳悕",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl #{@homework.anonymous_comment == 1 ? 'ml35' : 'ml18'}" ,:remote => true%> + <% if @show_all && @order == "lastname"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%> + <% end%> + + <%= link_to "瀛﹀彿",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml30" ,:remote => true%> + <% if @show_all && @order == "student_id"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%> + <% end%> + + 鍏宠仈椤圭洰 + + <%= link_to "鏃堕棿",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%> + <% if @show_all && @order == "created_at"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <% end%> + + <%= link_to "鏁欏笀",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%> + <% if @show_all && @order == "teacher_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%> + <% end%> + + <%= link_to "鏁欒緟",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <% if @show_all && @order == "teaching_asistant_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <% end%> + + <%= link_to "绯荤粺",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <% if @show_all && @order == "system_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <% end%> + + <%= link_to "鍖胯瘎",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <% if @show_all && @order == "student_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <% end%> + + <%= link_to "鎴愮哗",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <% if @show_all && @order == "score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <% end%> +
        +
        +
        +
        \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_title_archive.erb b/app/views/student_work/_evaluation_un_title_archive.erb new file mode 100644 index 000000000..f844e320b --- /dev/null +++ b/app/views/student_work/_evaluation_un_title_archive.erb @@ -0,0 +1,73 @@ +
          +
        • 搴忓彿
        • +
        •  
        • +
        • + 浣滃搧鍚嶇О +
        • + <% 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%> + <% end%> +
        • +
        • + + <%= link_to "瀛﹀彿",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml30" ,:remote => true%> + <% if @show_all && @order == "student_id"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%> + <% end%> +
        • + <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> +
        • + 鍏宠仈椤圭洰 +
        • + <% 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%> + <% if @show_all && @order == "created_at"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <% end%> +
        • + +
        • + <%= link_to "鏁欏笀",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%> + <% if @show_all && @order == "teacher_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%> + <% end%> +
        • + +
        • + <%= link_to "鏁欒緟",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <% if @show_all && @order == "teaching_asistant_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <% end%> +
        • + + <% if @homework.homework_type == 2%> +
        • + <%= link_to "绯荤粺",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <% if @show_all && @order == "system_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <% end%> +
        • + <% end%> + + <% if @homework.anonymous_comment == 0%> +
        • + <%= link_to "鍖胯瘎",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <% if @show_all && @order == "student_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <% end%> +
        • + <% end %> + +
        • + <%= link_to "鎴愮哗",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%> + <% if @show_all && @order == "score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%> + <% end%> +
        • +
        \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index de54585b3..ecdde77d8 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -1,60 +1,58 @@ - -
          -
        • <%=index + 1 %>
        • -
        • + + + <%=index + 1 %> + <%= 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 %> -
        • + <%= student_work.user.show_name%> -
        • -
        • " onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;"> - <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> -
        • + + " 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 %> <% 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))%> -
        • + <% else %> -
        • + <%= student_work.project.name %> -
        • + <% end %> <% end %> -
          -
        • + <% if student_work.created_at && @homework.end_time%> <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %> [杩熶氦] <% end %> <% end %> -
        • -
        • + + <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%> -
        • -
        • + + <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%> -
        • + <% if @homework.homework_type == 2%> -
        • + <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%> -
        • + <% end%> <% if @homework.anonymous_comment == 0%> -
        • + <% if student_work.student_score.nil? %> 鏈弬涓 <% else %> @@ -71,7 +69,7 @@  <%= format("%.1f",student_work.student_score)%> 鍒嗐
    <% end%> - + <% end %> <% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %> @@ -79,7 +77,7 @@ <% else %> <% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%> <% end %> -
  • + <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> <% unless score.nil?%>
    @@ -97,9 +95,9 @@  <%= format("%.1f",score<0 ? 0 : score)%> 鍒嗐
    <% end%> -
  • - - + +
    + <% user = User.find(reply.creator_id) %> @@ -164,6 +165,7 @@ postContent=postContent.replace(/  /g,"   "); $(this).html(postContent); }); + autoUrl('intro_content_<%= @document.id %>'); var replyCount = $(".homepagePostReplyContainer").size(); if (replyCount >3){ for(var i= 3; i < replyCount+1; i++){ diff --git a/app/views/users/_apply_homework_course_message.html.erb b/app/views/users/_apply_homework_course_message.html.erb index cf048bcd6..12bf0f2a4 100644 --- a/app/views/users/_apply_homework_course_message.html.erb +++ b/app/views/users/_apply_homework_course_message.html.erb @@ -1,12 +1,12 @@ -
  • +
  • <%= link_to User.find(ma.apply_user_id).show_name, - user_path(User.find(ma.apply_user_id)), :class => "newsBlue homepageNewsPublisher" %> + user_path(User.find(ma.apply_user_id)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> ">鐢宠寮曠敤浣滀笟锛
  • <% content = ma.content.nil? ? '' : '锛'+ ma.content.to_s %> - <%= link_to User.find(ma.apply_user_id).show_name+"鐢宠寮曠敤浣滀笟\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}", student_work_index_path(:homework => ma.course_message.id), :title => User.find(ma.apply_user_id).show_name+"鐢宠寮曠敤浣滀笟\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}",:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %> + <%= link_to User.find(ma.apply_user_id).show_name+"鐢宠寮曠敤浣滀笟\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}", student_work_index_path(:homework => ma.course_message.id), :title => User.find(ma.apply_user_id).show_name+"鐢宠寮曠敤浣滀笟\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}",:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}", :target => '_blank' %>
  • diff --git a/app/views/users/_apply_resource_course_message_reply.html.erb b/app/views/users/_apply_resource_course_message_reply.html.erb index 617ee53c3..2aff99c17 100644 --- a/app/views/users/_apply_resource_course_message_reply.html.erb +++ b/app/views/users/_apply_resource_course_message_reply.html.erb @@ -7,10 +7,10 @@
  • <%= link_to owner.show_name, user_path(owner), :class => "newsBlue homepageNewsPublisher" %> - "><%= ma.apply_result == 1 ? '鍚屾剰' : '鎷掔粷'%>寮曠敤璧勬簮锛 + "><%= ma.apply_result == 2 ? '鍚屾剰' : '鎷掔粷'%>寮曠敤璧勬簮锛
  • - <% link_str = ma.apply_result == 1 ? + <% link_str = ma.apply_result == 2 ? '鎮ㄧ敵璇峰紩鐢ㄨ祫婧"'+ ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename) + '"鐨勭敵璇峰凡閫氳繃' : '鎮ㄧ敵璇峰紩鐢ㄨ祫婧"'+ ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename) + '"鐨勭敵璇疯濠夋嫆' %> diff --git a/app/views/users/_comment_reply.html.erb b/app/views/users/_comment_reply.html.erb index ddc654463..895eda8a9 100644 --- a/app/views/users/_comment_reply.html.erb +++ b/app/views/users/_comment_reply.html.erb @@ -1,6 +1,6 @@
    <% unless comment.parent.nil? %> -
    +
    <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
    <% end %> diff --git a/app/views/users/_course_attachment.html.erb b/app/views/users/_course_attachment.html.erb index 63c57f708..4c0856b14 100644 --- a/app/views/users/_course_attachment.html.erb +++ b/app/views/users/_course_attachment.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -43,4 +43,4 @@ $(function(){ user_card_show_hide(); }); - \ No newline at end of file + diff --git a/app/views/users/_course_boardlist.html.erb b/app/views/users/_course_boardlist.html.erb index c92d117ee..bf23d9a97 100644 --- a/app/views/users/_course_boardlist.html.erb +++ b/app/views/users/_course_boardlist.html.erb @@ -45,8 +45,8 @@

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

    - 鍙戝笘鏃堕棿锛<%= format_time(activity.created_on) %> - 鏇存柊鏃堕棿锛<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> + 鍙戝笘锛<%= format_time(activity.created_on) %> + 鏇存柊锛<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> <% count=0 %> <% if activity.parent %> <% count=activity.parent.children.count%> diff --git a/app/views/users/_course_create.html.erb b/app/views/users/_course_create.html.erb index 6b2234337..83c703905 100644 --- a/app/views/users/_course_create.html.erb +++ b/app/views/users/_course_create.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
    -
    +
    <% if activity.try(:teacher).try(:realname) == ' ' %> <%= link_to activity.try(:teacher), user_path(activity.tea_id), :class => "newsBlue mr15" %> <% else %> @@ -39,4 +39,4 @@ $(function(){ user_card_show_hide(); }); - \ No newline at end of file + diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 28f0f99db..3721244ed 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -6,7 +6,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
    -
    +
    <% if activity.try(:user).try(:realname) == ' ' %> <%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> <% else %> @@ -216,9 +216,9 @@
    <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> - <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"椤圭洰澶村儚" %> + <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"椤圭洰澶村儚" %> <% else %> - <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"椤圭洰澶村儚") %> + <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"椤圭洰澶村儚") %> <% end %> <% com_time = project.project_score.commit_time %> <% time=project.updated_on %> @@ -321,6 +321,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb index 1d0c4cba5..aeb7f5e5d 100644 --- a/app/views/users/_course_journalsformessage.html.erb +++ b/app/views/users/_course_journalsformessage.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
    -
    +
    <% if activity.try(:user).try(:realname) == ' ' %> <%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %> <% else %> @@ -56,6 +56,7 @@ <% replies_all_i = replies_all_i + 1 %> diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 2f790b19b..8b6056309 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %> <% else %> @@ -117,6 +117,7 @@ <% replies_all_i=replies_all_i+1 %> @@ -125,7 +126,7 @@ <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if reply.try(:author).try(:realname) == ' ' %> <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> <% else %> @@ -179,4 +180,4 @@ $(function(){ user_card_show_hide(); }); - \ No newline at end of file + diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 403a922ed..19d62b14e 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if @ctivity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -94,6 +94,7 @@ <% replies_all_i = replies_all_i + 1 %> @@ -102,7 +103,7 @@ <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if comment.try(:author).try(:realname) == ' ' %> <%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/users/_course_newslist.html.erb b/app/views/users/_course_newslist.html.erb index ff99e116e..0e5805112 100644 --- a/app/views/users/_course_newslist.html.erb +++ b/app/views/users/_course_newslist.html.erb @@ -33,8 +33,8 @@

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

    - 鍙戝竷鏃堕棿锛<%= format_time(activity.created_on) %> - 鏇存柊鏃堕棿锛<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> + 鍙戝竷锛<%= format_time(activity.created_on) %> + 鏇存柊锛<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> <% count=0 %> <% count=activity.comments.count %>

    <%= count>0 ? "#{count}" : "0" %>鍥炲|<%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %>

    diff --git a/app/views/users/_course_poll.html.erb b/app/views/users/_course_poll.html.erb index dab970cdf..4fbb55321 100644 --- a/app/views/users/_course_poll.html.erb +++ b/app/views/users/_course_poll.html.erb @@ -9,7 +9,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
    -
    +
    <% if activity.try(:user).try(:realname) == ' ' %> <%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %> <% else %> diff --git a/app/views/users/_intro_content.html.erb b/app/views/users/_intro_content.html.erb index c18e520ba..04babe100 100644 --- a/app/views/users/_intro_content.html.erb +++ b/app/views/users/_intro_content.html.erb @@ -1,6 +1,6 @@ -
    +
    - <%= content.to_s.html_safe%> + <%= content.to_s.html_safe %>
    \ No newline at end of file diff --git a/app/views/users/_join_course_course_message.html.erb b/app/views/users/_join_course_course_message.html.erb index 28675b7eb..01ebb5cf9 100644 --- a/app/views/users/_join_course_course_message.html.erb +++ b/app/views/users/_join_course_course_message.html.erb @@ -6,7 +6,7 @@
  • <%= link_to User.find(ma.course_message_id).name+"鐢宠鎴愪负璇剧▼\""+"#{Course.find(ma.course_id).name}"+"\"鐨"+"#{ma.content == '9' ? "鏁欏笀" : "鏁欒緟"}", user_path(User.find(ma.course_message_id), :course_id => ma.course_id), - :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}" %> + :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> diff --git a/app/views/users/_project_attachment.html.erb b/app/views/users/_project_attachment.html.erb index 795432008..ed4f8cfb8 100644 --- a/app/views/users/_project_attachment.html.erb +++ b/app/views/users/_project_attachment.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
  • -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -43,4 +43,4 @@ $(function(){ user_card_show_hide(); }); - \ No newline at end of file + diff --git a/app/views/users/_project_boardlist.html.erb b/app/views/users/_project_boardlist.html.erb index 55f576db1..25fd675fb 100644 --- a/app/views/users/_project_boardlist.html.erb +++ b/app/views/users/_project_boardlist.html.erb @@ -45,8 +45,8 @@

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

    - 鍙戝笘鏃堕棿锛<%= format_time(activity.created_on) %> - 鏇存柊鏃堕棿锛<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> + 鍙戝笘锛<%= format_time(activity.created_on) %> + 鏇存柊锛<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> <% count=0 %> <% if activity.parent %> <% count=activity.parent.children.count%> diff --git a/app/views/users/_project_create.html.erb b/app/views/users/_project_create.html.erb index 83bfe3f04..644918ccc 100644 --- a/app/views/users/_project_create.html.erb +++ b/app/views/users/_project_create.html.erb @@ -7,7 +7,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
    -
    +
    <% if user.try(:realname) == ' ' %> <%= link_to user, user_path(user), :class => "newsBlue mr15" %> <% else %> @@ -41,4 +41,4 @@ $(function(){ user_card_show_hide(); }); - \ No newline at end of file + diff --git a/app/views/users/_project_document.html.erb b/app/views/users/_project_document.html.erb index eb3ff2122..5427bd112 100644 --- a/app/views/users/_project_document.html.erb +++ b/app/views/users/_project_document.html.erb @@ -3,7 +3,7 @@
    鐢ㄦ埛澶村儚
    -
    灏规暀鎺 TO + diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index daa7c71c2..4b13850de 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -100,4 +100,4 @@ $(function(){ user_card_show_hide(); }); - \ No newline at end of file + diff --git a/app/views/users/_project_issue_reply.html.erb b/app/views/users/_project_issue_reply.html.erb index 5020f67d3..5323b76b6 100644 --- a/app/views/users/_project_issue_reply.html.erb +++ b/app/views/users/_project_issue_reply.html.erb @@ -29,6 +29,7 @@ <% replies_all_i=replies_all_i + 1 %> @@ -37,7 +38,7 @@ <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if reply.try(:user).try(:realname) == ' ' %> <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/users/_project_journal.html.erb b/app/views/users/_project_journal.html.erb index 7cf487211..1efbf1c7d 100644 --- a/app/views/users/_project_journal.html.erb +++ b/app/views/users/_project_journal.html.erb @@ -3,7 +3,7 @@
    鐢ㄦ埛澶村儚
    -
    灏规暀鎺 TO + diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 0a41dbbf5..b6e3f9a94 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -112,6 +112,7 @@ <% replies_all_i=replies_all_i+1 %> @@ -120,7 +121,7 @@ <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if reply.try(:author).try(:realname) == ' ' %> <%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/users/_project_news.html.erb b/app/views/users/_project_news.html.erb index 7f5d185e5..55e2182b5 100644 --- a/app/views/users/_project_news.html.erb +++ b/app/views/users/_project_news.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if @ctivity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -91,6 +91,7 @@ <% replies_all_i = replies_all_i + 1 %> @@ -99,7 +100,7 @@ <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if comment.try(:author).try(:realname) == ' ' %> <%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index 3397d5929..3aaed7594 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -6,7 +6,7 @@ <% attachments.each do |attach| %>
    • - <% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current %> + <% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> <% else %> @@ -14,15 +14,19 @@
    • - <%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack resource-list-middle hidden mw280' %> - <% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current %> + <% if private_attachment_allow(attach.id) %> + + <% else %> + <%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack resource-list-middle hidden mw280' %> + <% end %> + <% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> 绉佹湁 <% end %>
    • - <% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current %> + <% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> <% ah = attach.get_status_by_attach(User.current.id) %> - <% if ah.nil? %> + <% if ah.nil? %> <%= link_to("璇锋眰鍒嗕韩", apply_resource_user_path(User.current.id, :attachment_id => attach.id), :class => 'green_btn_share c_white', :remote => true) %> <% elsif ah == 1 %> 绛夊緟鍥炲 @@ -32,7 +36,12 @@ 宸叉嫆缁 <% end %> <% else %> - -- + <% ah = attach.get_status_by_attach(User.current.id) %> + <% if ah == 2 %> + 鍙紩鐢 + <% else %> + -- + <% end %> <% end %>
    • <%= format_date(attach.created_on) %>
    • @@ -43,8 +52,9 @@
    • <%= get_resource_type(attach.container_type)%>
    • -
    • <%= attach.is_public %>
    • -
    • <%= attach.get_apply_resource_status(attach.id, attach.author_id) %>
    • +
    • <%= private_attachment_allow(attach.id) %>
    • +
    • <%= attach.get_apply_resource_status(attach.id, User.current.id) %>
    • +
    • <%= private_attachment_allow(attach.id) ? 0 : 1 %>
    • <%= attach.id %>
    @@ -66,14 +76,15 @@ //鎵归噺鍒犻櫎 function batch_delete(){ var data = $("#resources_list_form").serialize(); + if($("input[type=checkbox][data-deleteble=N]:checked").length != 0){ + alert("鎮ㄦ棤娉曞垹闄ゆ璧勬簮锛"); + return; + } if($("input[type=checkbox][data-has-history=Y]:checked").length != 0){ alert("鎮ㄥ彧鑳藉垹闄ゆ病鏈夊巻鍙茶褰曠殑璧勬簮锛岃閲嶆柊閫夋嫨鍚庡啀鍒犻櫎銆"); return; } - if($("input[type=checkbox][data-deleteble=N]:checked").length != 0){ - alert("鎮ㄥ彧鑳藉垹闄よ嚜宸变笂浼犵殑璧勬簮锛岃閲嶆柊閫夋嫨鍚庡啀鍒犻櫎銆"); - return; - } + if(data != "" && confirm('纭瑕佸垹闄よ繖浜涜祫婧愬悧锛')) { $.post( @@ -93,10 +104,9 @@ document.oncontextmenu = function() {return true;} line.children().css("background-color",'white'); id = line.children().last().html(); - is_public = line.children().eq(11).html(); user_id = line.children().eq(6).html(); - apply_status = line.children().eq(12).html(); - if(is_public == 0 && user_id != '<%= User.current.id %>' && apply_status != 2){ + allow = line.children().eq(13).html(); + if( allow == 0){ alert('鎮ㄦ棤鏉冨彂閫佺鏈夎祫婧') }else{ if (lastSendType === '2'){ //濡傛灉宸茬粡鍙戦佽繃涓娆′簡锛岄偅涔堝氨搴旇娌跨敤涓婃鍙戦佺殑绫诲瀷銆 @@ -210,19 +220,21 @@ line.children().css("background-color", 'white'); id = line.children().last().html(); user_id = line.children().eq(6).html(); - if(line.children().first().children().data('hasHistory') == 'Y'){ - alert('璇ヨ祫婧愬瓨鍦ㄥ巻鍙茬増鏈紝涓嶈兘鍒犻櫎'); - return; - } if(user_id === '<%= User.current.id%>') { + if(line.children().first().children().data('hasHistory') == 'Y'){ + alert('璇ヨ祫婧愬瓨鍦ㄥ巻鍙茬増鏈紝涓嶈兘鍒犻櫎'); + return; + } if (confirm('纭畾瑕佸垹闄よ祫婧"' + line.children().eq(1).children().attr('title').trim() + '"涔?')) { $.ajax({ type: 'post', url: '<%= user_resource_delete_user_path(User.current.id)%>' + '?resource_id=' + id + '&type=<%=@type %>&status=<%=@status %>' }); } + }else{ alert('鎮ㄦ棤娉曞垹闄ゆ璧勬簮锛') } + } diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index b7df824a4..2fe7315d5 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -54,7 +54,7 @@ sd_create_editor_from_data(<%= user_activity.id %>, null, "100%", "<%= user_activity.class.to_s %>"); }); - <% if user_activity.act_type == "ProjectCreateInfo" %> + <% if user_activity.act_type == "Project" %> <%= render :partial => 'project_create', :locals => {:activity => user_activity,:user_activity_id =>user_activity.id} %> <% else %> <% act= user_activity.act %> @@ -94,7 +94,7 @@ <%# end %> <% when 'Message' %> <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %> - <% when 'ProjectCreateInfo'%> + <% when 'Project'%> <%# cache (act) do %> <%= render :partial => 'project_create', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> <%# end %> diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index 74f090344..de5ffc31f 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -5,7 +5,7 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    <% if @ctivity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -16,13 +16,13 @@
    <%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:in_act => true), :class => "postGrey" %> + <% if activity.locked%> +       + <% end%> + <% if activity.sticky == 1%> + 缃《 + <% end%>
    - <% if activity.sticky == 1%> - 缃《 - <% end%> - <% if activity.locked%> -        - <% end%>
    @@ -75,6 +75,7 @@ <% replies_all_i = replies_all_i + 1 %> @@ -83,7 +84,7 @@ <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "鐢ㄦ埛澶村儚" %>
    -
    +
    <% if comment.try(:author).try(:realname) == ' ' %> <%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> <% else %> diff --git a/app/views/users/_user_course_list.html.erb b/app/views/users/_user_course_list.html.erb index 8ef0faa9e..5e3f48963 100644 --- a/app/views/users/_user_course_list.html.erb +++ b/app/views/users/_user_course_list.html.erb @@ -28,12 +28,10 @@
  • + + 鏇存柊锛<%= format_time(course.updated_on) %> - 鍒涘缓鏃堕棿锛<%= format_time(course.created_at) %> - - 鏇存柊鏃堕棿锛<%= format_time(course.updated_on) %> - - 寮璇惧鏈:  <%= current_time_and_term course %> + 瀛︽湡:  <%= current_time_and_term course %> <% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %> <% homework_num = course.homework_commons.count %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index b8c5c2017..f81fbabf5 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -5,13 +5,18 @@ <%=link_to image_tag(url_to_avatar(homework_common.user),width:"50px", height: "50px"), user_activities_path(homework_common.user.id)%>
  • -
    +
    <%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%> TO <%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
    <% if homework_common.homework_detail_manual%> @@ -219,9 +224,9 @@
    <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> - <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"椤圭洰澶村儚" %> + <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"椤圭洰澶村儚" %> <% else %> - <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"椤圭洰澶村儚") %> + <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"椤圭洰澶村儚") %> <% end %> <% com_time = project.project_score.commit_time %> <% time=project.updated_on %> @@ -326,6 +331,7 @@ <% replies_all_i = replies_all_i + 1 %> @@ -352,12 +358,16 @@ <% else %>
    -
    +
    <%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
    <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
    -
    <%= link_to '鐐瑰嚮灞曞紑闅愯棌妤煎眰', show_all_replies_users_path(:comment => comment),:remote=>true %>
    +
    + + + <%= link_to '鐐瑰嚮灞曞紑闅愯棌妤煎眰', show_all_replies_users_path(:comment => comment),:remote=>true %> +
    <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
    <% end %> diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index e42c5d8b2..f7669047c 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -31,7 +31,7 @@ <% if homework_commons.count == 10%> <% if is_in_course == 1%> - <%= link_to "鐐瑰嚮灞曞紑鏇村",homework_common_index_path(:course => course_id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%> + <%#= link_to "鐐瑰嚮灞曞紑鏇村",homework_common_index_path(:course => course_id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%> <% else%> <%= link_to "鐐瑰嚮灞曞紑鏇村",student_homeworks_user_path(User.current.id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%> diff --git a/app/views/users/_user_import_resource_list.html.erb b/app/views/users/_user_import_resource_list.html.erb index 38770421d..e8ed684c6 100644 --- a/app/views/users/_user_import_resource_list.html.erb +++ b/app/views/users/_user_import_resource_list.html.erb @@ -6,8 +6,22 @@
    - + + +
    閫夋嫨 0 涓祫婧
    diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb index 6405ba496..4a7e5cee3 100644 --- a/app/views/users/new_user_commit_homework.html.erb +++ b/app/views/users/new_user_commit_homework.html.erb @@ -92,6 +92,15 @@
    璇蜂娇鐢 <%= @homework.language_name %> 璇█缂栧啓 + <% if @homework.language.to_i == 1 %> + 缂栬瘧鍣ㄤ俊鎭細gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) + <% elsif @homework.language.to_i == 2 %> + 缂栬瘧鍣ㄤ俊鎭細gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) + <% elsif @homework.language.to_i == 3 %> + 缂栬瘧鍣ㄤ俊鎭細Python version "2.6.6" + <% elsif @homework.language.to_i == 4 %> + 缂栬瘧鍣ㄤ俊鎭細java version "1.7.0_85" OpenJDK Runtime Environment + <% end %> style="display-hidden" id="data-language">
    diff --git a/app/views/users/user_commit_homework.html.erb b/app/views/users/user_commit_homework.html.erb index 6df6f2115..1d1d0ef14 100644 --- a/app/views/users/user_commit_homework.html.erb +++ b/app/views/users/user_commit_homework.html.erb @@ -75,6 +75,15 @@
    璇蜂娇鐢 <%= @homework.language_name %> 璇█缂栧啓 + <% if @homework.language.to_i == 1 %> + 缂栬瘧鍣ㄤ俊鎭細gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) + <% elsif @homework.language.to_i == 2 %> + 缂栬瘧鍣ㄤ俊鎭細gcc version "4.4.7" 20120313 (Red Hat 4.4.7-11) (GCC) + <% elsif @homework.language.to_i == 3 %> + 缂栬瘧鍣ㄤ俊鎭細Python version "2.6.6" + <% elsif @homework.language.to_i == 4 %> + 缂栬瘧鍣ㄤ俊鎭細java version "1.7.0_85" OpenJDK Runtime Environment + <% end %>
    <%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"璇锋鎷綘鐨勪唬鐮佺殑鍔熻兘" %> diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb index 0bd5724c1..483dceaed 100644 --- a/app/views/users/user_resource.html.erb +++ b/app/views/users/user_resource.html.erb @@ -56,7 +56,7 @@ 鎴戠殑璧勬簮
  • - 绉佹湁璧勬簮 + 鐢宠璧勬簮
  •  
  • diff --git a/app/views/users/user_system_messages.html.erb b/app/views/users/user_system_messages.html.erb index 86ae56cc8..57c6eb573 100644 --- a/app/views/users/user_system_messages.html.erb +++ b/app/views/users/user_system_messages.html.erb @@ -7,7 +7,7 @@ <%= image_tag("/images/trustie_logo1.png", :width => "50", :height => "50") %>
  • -
    +
    Trustie骞冲彴 鍙戝竷浜嗙郴缁熸秷鎭細 <%= system_message.subject.nil? ? "绯荤粺娑堟伅" : system_message.subject %>
    diff --git a/app/views/words/_new_respond_course.html.erb b/app/views/words/_new_respond_course.html.erb index 3be435b15..88581b3bf 100644 --- a/app/views/words/_new_respond_course.html.erb +++ b/app/views/words/_new_respond_course.html.erb @@ -12,8 +12,8 @@ <%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
    - - <%= submit_tag l(:button_feedback_respond), :name => nil , + + <%#= submit_tag l(:button_feedback_respond), :name => nil , :class => "reply_btn"%> <% end %> \ No newline at end of file diff --git a/app/views/words/_new_respond_project.html.erb b/app/views/words/_new_respond_project.html.erb index c3ff241b3..4430735a2 100644 --- a/app/views/words/_new_respond_project.html.erb +++ b/app/views/words/_new_respond_project.html.erb @@ -11,7 +11,8 @@ <%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
    - <%= submit_tag l(:button_feedback_respond), :name => nil , + + <%#= submit_tag l(:button_feedback_respond), :name => nil , :class => "reply_btn"%> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 18f027dce..a347359bb 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2137,6 +2137,7 @@ zh: label_notice_comment_template: 鎮ㄧ殑璇剧▼閫氱煡鏈夋柊鍥炲浜 label_news_comment_template: 鎮ㄧ殑椤圭洰鏂伴椈鏈夋柊鍥炲浜 label_homework_comment_template: 鎮ㄧ殑浣滀笟鏈夋柊鍥炲浜 + label_new_second_comment_template: 鎮ㄦ湁鏂板洖澶嶄簡 label_new_journals_template: 鎮ㄦ湁鏂扮暀瑷浜 label_journals_comment_template: 鎮ㄧ殑鐣欒█鏈夋柊鍥炲浜 label_blog_comment_template: 鎮ㄧ殑鍗氬鏈夋柊鍥炲浜 diff --git a/config/menu.yml b/config/menu.yml index d129f7aff..3951f836b 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -5,7 +5,7 @@ button: url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/activities?response_type=code&scope=snsapi_base&state=123#wechat_redirect" - type: "click" - name: "鎰忚杩旈" + name: "鎰忚鍙嶉" key: "FEEDBACK" - name: "鏇村" diff --git a/config/routes.rb b/config/routes.rb index 98d90c753..2863d49a4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1071,6 +1071,7 @@ RedmineApp::Application.routes.draw do match "addgroups", :via => [:post, :get] match 'deletegroup', :via => [:delete] match 'show_member_score', :via => [:get] + match 'show_member_act_score', :via => [:get] match 'valid_ajax', :to => 'courses#valid_ajax', :via => :get post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group' delete 'join_in/join_group', :to => 'courses#unjoin_group' diff --git a/db/migrate/20160517013659_alter_course_contributor_score_default.rb b/db/migrate/20160517013659_alter_course_contributor_score_default.rb new file mode 100644 index 000000000..488dab848 --- /dev/null +++ b/db/migrate/20160517013659_alter_course_contributor_score_default.rb @@ -0,0 +1,52 @@ +class AlterCourseContributorScoreDefault < ActiveRecord::Migration + def up + change_column :course_contributor_scores, :message_num, :integer, :default => 0 + change_column :course_contributor_scores, :message_reply_num, :integer, :default => 0 + change_column :course_contributor_scores, :news_reply_num, :integer, :default => 0 + change_column :course_contributor_scores, :news_num, :integer, :default => 0 + change_column :course_contributor_scores, :resource_num, :integer, :default => 0 + change_column :course_contributor_scores, :journal_num, :integer, :default => 0 + change_column :course_contributor_scores, :journal_reply_num, :integer, :default => 0 + change_column :course_contributor_scores, :homework_journal_num, :integer, :default => 0 + change_column :course_contributor_scores, :total_score, :integer, :default => 0 + + count = CourseContributorScore.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + CourseContributorScore.page(i).per(30).each do |cs| + if cs.message_num.nil? + cs.message_num = 0 + end + if cs.message_reply_num.nil? + cs.message_reply_num = 0 + end + if cs.news_reply_num.nil? + cs.news_reply_num = 0 + end + if cs.news_num.nil? + cs.news_num = 0 + end + if cs.resource_num.nil? + cs.resource_num = 0 + end + if cs.journal_num.nil? + cs.journal_num = 0 + end + if cs.journal_reply_num.nil? + cs.journal_reply_num = 0 + end + if cs.homework_journal_num.nil? + cs.homework_journal_num = 0 + end + if cs.total_score.nil? + cs.total_score = 0 + end + cs.save + end + end + end + end + + def down + end +end diff --git a/db/migrate/20160519070718_change_user_activities_data.rb b/db/migrate/20160519070718_change_user_activities_data.rb new file mode 100644 index 000000000..1a1bfb827 --- /dev/null +++ b/db/migrate/20160519070718_change_user_activities_data.rb @@ -0,0 +1,9 @@ +class ChangeUserActivitiesData < ActiveRecord::Migration + def up + execute("update user_activities set act_type = 'Project' where act_type = 'ProjectCreateInfo'") + execute("update org_activities set org_act_type = 'Project' where org_act_type = 'ProjectCreateInfo'") + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 58cb9b8ae..9c4b4b333 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160518060243) do +ActiveRecord::Schema.define(:version => 20160519070718) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -52,28 +52,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - create_table "application_settings", :force => true do |t| - t.integer "default_projects_limit" - t.boolean "signup_enabled" - t.boolean "signin_enabled" - t.boolean "gravatar_enabled" - t.text "sign_in_text" - t.datetime "created_at" - t.datetime "updated_at" - t.string "home_page_url" - t.integer "default_branch_protection", :default => 2 - t.boolean "twitter_sharing_enabled", :default => true - t.text "restricted_visibility_levels" - t.boolean "version_check_enabled", :default => true - t.integer "max_attachment_size", :default => 10, :null => false - t.integer "default_project_visibility" - t.integer "default_snippet_visibility" - t.text "restricted_signup_domains" - t.boolean "user_oauth_applications", :default => true - t.string "after_sign_out_path" - t.integer "session_expire_delay", :default => 10080, :null => false - end - create_table "applied_projects", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false @@ -99,18 +77,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.datetime "updated_at", :null => false end - create_table "apply_resources", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "attachment_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id" - t.string "container_type" - t.text "content" - t.integer "apply_user_id" - end - create_table "at_messages", :force => true do |t| t.integer "user_id" t.integer "at_message_id" @@ -178,20 +144,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.string "typeName", :limit => 50 end - create_table "audit_events", :force => true do |t| - t.integer "author_id", :null => false - t.string "type", :null => false - t.integer "entity_id", :null => false - t.string "entity_type", :null => false - t.text "details" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id" - add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type" - add_index "audit_events", ["type"], :name => "index_audit_events_on_type" - create_table "auth_sources", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 60, :default => "", :null => false @@ -289,17 +241,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" add_index "boards", ["project_id"], :name => "boards_project_id" - create_table "broadcast_messages", :force => true do |t| - t.text "message", :null => false - t.datetime "starts_at" - t.datetime "ends_at" - t.integer "alert_type" - t.datetime "created_at" - t.datetime "updated_at" - t.string "color" - t.string "font" - end - create_table "bug_to_osps", :force => true do |t| t.integer "osp_id" t.integer "relative_memo_id" @@ -509,15 +450,15 @@ ActiveRecord::Schema.define(:version => 20160518060243) do create_table "course_contributor_scores", :force => true do |t| t.integer "course_id" t.integer "user_id" - t.integer "message_num" - t.integer "message_reply_num" - t.integer "news_reply_num" - t.integer "resource_num" - t.integer "journal_num" - t.integer "journal_reply_num" + t.integer "message_num", :default => 0 + t.integer "message_reply_num", :default => 0 + t.integer "news_reply_num", :default => 0 + t.integer "resource_num", :default => 0 + t.integer "journal_num", :default => 0 + t.integer "journal_reply_num", :default => 0 t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "total_score" + t.integer "total_score", :default => 0 t.integer "homework_journal_num", :default => 0 t.integer "news_num", :default => 0 end @@ -599,10 +540,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.integer "visits", :default => 0 end - add_index "courses", ["id"], :name => "id", :unique => true - add_index "courses", ["tea_id"], :name => "tea_id" - add_index "courses", ["visits"], :name => "visits" - create_table "custom_fields", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 30, :default => "", :null => false @@ -664,15 +601,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "deploy_keys_projects", :force => true do |t| - t.integer "deploy_key_id", :null => false - t.integer "project_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id" - create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -722,16 +650,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.datetime "created_at" end - create_table "emails", :force => true do |t| - t.integer "user_id", :null => false - t.string "email", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true - add_index "emails", ["user_id"], :name => "index_emails_on_user_id" - create_table "enabled_modules", :force => true do |t| t.integer "project_id" t.string "name", :null => false @@ -754,25 +672,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - create_table "events", :force => true do |t| - t.string "target_type" - t.integer "target_id" - t.string "title" - t.text "data" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "action" - t.integer "author_id" - end - - add_index "events", ["action"], :name => "index_events_on_action" - add_index "events", ["author_id"], :name => "index_events_on_author_id" - add_index "events", ["created_at"], :name => "index_events_on_created_at" - add_index "events", ["project_id"], :name => "index_events_on_project_id" - add_index "events", ["target_id"], :name => "index_events_on_target_id" - add_index "events", ["target_type"], :name => "index_events_on_target_type" - create_table "exercise_answers", :force => true do |t| t.integer "user_id" t.integer "exercise_question_id" @@ -875,15 +774,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" - create_table "forked_project_links", :force => true do |t| - t.integer "forked_to_project_id", :null => false - t.integer "forked_from_project_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true - create_table "forums", :force => true do |t| t.string "name", :null => false t.text "description" @@ -1013,17 +903,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.datetime "updated_at", :null => false end - create_table "identities", :force => true do |t| - t.string "extern_uid" - t.string "provider" - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id" - add_index "identities", ["user_id"], :name => "index_identities_on_user_id" - create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1167,20 +1046,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.integer "private", :default => 0 end - create_table "keys", :force => true do |t| - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - t.text "key" - t.string "title" - t.string "type" - t.string "fingerprint" - t.boolean "public", :default => false, :null => false - end - - add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id" - add_index "keys", ["user_id"], :name => "index_keys_on_user_id" - create_table "kindeditor_assets", :force => true do |t| t.string "asset" t.integer "file_size" @@ -1192,27 +1057,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.integer "owner_type", :default => 0 end - create_table "label_links", :force => true do |t| - t.integer "label_id" - t.integer "target_id" - t.string "target_type" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id" - add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type" - - create_table "labels", :force => true do |t| - t.string "title" - t.string "color" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "labels", ["project_id"], :name => "index_labels_on_project_id" - create_table "member_roles", :force => true do |t| t.integer "member_id", :null => false t.integer "role_id", :null => false @@ -1263,47 +1107,23 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.integer "viewed_count", :default => 0 end - create_table "merge_request_diffs", :force => true do |t| - t.string "state" - t.text "st_commits", :limit => 2147483647 - t.text "st_diffs", :limit => 2147483647 - t.integer "merge_request_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" + create_table "mess", :id => false, :force => true do |t| + t.string "璇剧▼鍚" + t.integer "璇剧▼ID", :default => 0, :null => false + t.string "鏁欏笀濮", :default => "", :null => false + t.string "鏁欏笀鍚", :limit => 30, :default => "", :null => false + t.string "涓昏创鍚", :default => "", :null => false + t.integer "涓昏创鎴栧洖甯朓D", :default => 0, :null => false + t.integer "鍥炲笘瀵瑰簲涓昏创ID" + t.integer "甯栧瓙鐐硅禐鏁" + t.integer "涓昏创鍥炲鏁", :default => 0, :null => false + t.text "涓昏创鎴栧洖甯栧唴瀹" + t.datetime "鍙戝笘鏃堕棿", :null => false + t.integer "鍙戝笘鎴栧洖甯栫敤鎴稩D", :default => 0, :null => false + t.string "鍙戝笘鎴栧洖甯栫敤鎴峰", :default => "", :null => false + t.string "鍙戝笘鎴栧洖甯栫敤鎴峰悕", :limit => 30, :default => "", :null => false end - add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true - - create_table "merge_requests", :force => true do |t| - t.string "target_branch", :null => false - t.string "source_branch", :null => false - t.integer "source_project_id", :null => false - t.integer "author_id" - t.integer "assignee_id" - t.string "title" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "milestone_id" - t.string "state" - t.string "merge_status" - t.integer "target_project_id", :null => false - t.integer "iid" - t.text "description" - t.integer "position", :default => 0 - t.datetime "locked_at" - end - - add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id" - add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id" - add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id" - add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at" - add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id" - add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch" - add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id" - add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch" - add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true - add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title" - create_table "message_alls", :force => true do |t| t.integer "user_id" t.integer "message_id" @@ -1338,39 +1158,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" - create_table "milestones", :force => true do |t| - t.string "title", :null => false - t.integer "project_id", :null => false - t.text "description" - t.date "due_date" - t.datetime "created_at" - t.datetime "updated_at" - t.string "state" - t.integer "iid" - end - - add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id" - add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date" - add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true - add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id" - - create_table "namespaces", :force => true do |t| - t.string "name", :null => false - t.string "path", :null => false - t.integer "owner_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "type" - t.string "description", :default => "", :null => false - t.string "avatar" - end - - add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id" - add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true - add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id" - add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true - add_index "namespaces", ["type"], :name => "index_namespaces_on_type" - create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -1396,31 +1183,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.datetime "updated_at", :null => false end - create_table "notes", :force => true do |t| - t.text "note" - t.string "noteable_type" - t.integer "author_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "project_id" - t.string "attachment" - t.string "line_code" - t.string "commit_id" - t.integer "noteable_id" - t.boolean "system", :default => false, :null => false - t.text "st_diff", :limit => 2147483647 - end - - add_index "notes", ["author_id"], :name => "index_notes_on_author_id" - add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id" - add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id" - add_index "notes", ["created_at"], :name => "index_notes_on_created_at" - add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type" - add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type" - add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type" - add_index "notes", ["project_id"], :name => "index_notes_on_project_id" - add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at" - create_table "notificationcomments", :force => true do |t| t.string "notificationcommented_type" t.integer "notificationcommented_id" @@ -1430,49 +1192,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.datetime "updated_at", :null => false end - create_table "oauth_access_grants", :force => true do |t| - t.integer "resource_owner_id", :null => false - t.integer "application_id", :null => false - t.string "token", :null => false - t.integer "expires_in", :null => false - t.text "redirect_uri", :null => false - t.datetime "created_at", :null => false - t.datetime "revoked_at" - t.string "scopes" - end - - add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true - - create_table "oauth_access_tokens", :force => true do |t| - t.integer "resource_owner_id" - t.integer "application_id" - t.string "token", :null => false - t.string "refresh_token" - t.integer "expires_in" - t.datetime "revoked_at" - t.datetime "created_at", :null => false - t.string "scopes" - end - - add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true - add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id" - add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true - - create_table "oauth_applications", :force => true do |t| - t.string "name", :null => false - t.string "uid", :null => false - t.string "secret", :null => false - t.text "redirect_uri", :null => false - t.string "scopes", :default => "", :null => false - t.datetime "created_at" - t.datetime "updated_at" - t.integer "owner_id" - t.string "owner_type" - end - - add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type" - add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true - create_table "onclick_times", :force => true do |t| t.integer "user_id" t.datetime "onclick_time" @@ -1629,23 +1348,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.integer "allow_teacher", :default => 0 end - create_table "permissions", :force => true do |t| - t.string "controller", :limit => 30, :default => "", :null => false - t.string "action", :limit => 30, :default => "", :null => false - t.string "description", :limit => 60, :default => "", :null => false - t.boolean "is_public", :default => false, :null => false - t.integer "sort", :default => 0, :null => false - t.boolean "mail_option", :default => false, :null => false - t.boolean "mail_enabled", :default => false, :null => false - end - - create_table "permissions_roles", :id => false, :force => true do |t| - t.integer "permission_id", :default => 0, :null => false - t.integer "role_id", :default => 0, :null => false - end - - add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id" - create_table "phone_app_versions", :force => true do |t| t.string "version" t.text "description" @@ -1728,11 +1430,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.datetime "updated_at", :null => false end - create_table "project_import_data", :force => true do |t| - t.integer "project_id" - t.text "data" - end - create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1822,16 +1519,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - create_table "protected_branches", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :null => false - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "developers_can_push", :default => false, :null => false - end - - add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id" - create_table "queries", :force => true do |t| t.integer "project_id" t.string "name", :default => "", :null => false @@ -1966,25 +1653,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.integer "is_teacher_score", :default => 0 end - create_table "services", :force => true do |t| - t.string "type" - t.string "title" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "active", :default => false, :null => false - t.text "properties" - t.boolean "template", :default => false - t.boolean "push_events", :default => true - t.boolean "issues_events", :default => true - t.boolean "merge_requests_events", :default => true - t.boolean "tag_push_events", :default => true - t.boolean "note_events", :default => true, :null => false - end - - add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id" - add_index "services", ["project_id"], :name => "index_services_on_project_id" - create_table "settings", :force => true do |t| t.string "name", :default => "", :null => false t.text "value" @@ -2023,26 +1691,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.datetime "updated_at", :null => false end - create_table "snippets", :force => true do |t| - t.string "title" - t.text "content", :limit => 2147483647 - t.integer "author_id", :null => false - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "file_name" - t.datetime "expires_at" - t.string "type" - t.integer "visibility_level", :default => 0, :null => false - end - - add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id" - add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id" - add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at" - add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at" - add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id" - add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level" - create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -2115,9 +1763,9 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.integer "absence_penalty", :default => 0 t.float "system_score", :default => 0.0 t.boolean "is_test", :default => false - t.float "work_score" t.integer "simi_id" t.integer "simi_value" + t.float "work_score" end add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" @@ -2165,13 +1813,13 @@ ActiveRecord::Schema.define(:version => 20160518060243) do create_table "sub_domains", :force => true do |t| t.integer "org_subfield_id" - t.integer "priority" + t.integer "priority", :default => 0 t.string "name" t.string "field_type" - t.integer "hide" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "hide", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "subfield_subdomain_dirs", :force => true do |t| @@ -2181,17 +1829,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.datetime "updated_at", :null => false end - create_table "subscriptions", :force => true do |t| - t.integer "user_id" - t.integer "subscribable_id" - t.string "subscribable_type" - t.boolean "subscribed" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true - create_table "system_messages", :force => true do |t| t.integer "user_id" t.string "content" @@ -2431,17 +2068,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" add_index "users", ["type"], :name => "index_users_on_type" - create_table "users_star_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id" - add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true - add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id" - create_table "versions", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "name", :default => "", :null => false @@ -2493,23 +2119,6 @@ ActiveRecord::Schema.define(:version => 20160518060243) do t.datetime "updated_at", :null => false end - create_table "web_hooks", :force => true do |t| - t.string "url" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "type", :default => "ProjectHook" - t.integer "service_id" - t.boolean "push_events", :default => true, :null => false - t.boolean "issues_events", :default => false, :null => false - t.boolean "merge_requests_events", :default => false, :null => false - t.boolean "tag_push_events", :default => false - t.boolean "note_events", :default => false, :null => false - end - - add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id" - add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id" - create_table "wechat_logs", :force => true do |t| t.string "openid", :null => false t.text "request_raw" diff --git a/lib/rails_kindeditor/config/routes.rb b/lib/rails_kindeditor/config/routes.rb index 86b888ad3..e205376d9 100644 --- a/lib/rails_kindeditor/config/routes.rb +++ b/lib/rails_kindeditor/config/routes.rb @@ -2,6 +2,6 @@ Rails.application.routes.draw do namespace :kindeditor do post "/upload" => "assets#create" get "/filemanager" => "assets#list" - get "/uploadpic" => "assets#uploadpic" + post "/uploadpic" => "assets#uploadpic" end end \ No newline at end of file diff --git a/lib/wechat/bin/wechat b/lib/wechat/bin/wechat old mode 100644 new mode 100755 diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 9ae1300e7..a8c17345b 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -2539,7 +2539,7 @@ function _nativeCommand(doc, key, val) { function _nativeCommandValue(doc, key) { var val = ''; try { - val = doc.queryCommandValue(key); + val = doc.query_nativeCommand(self.doc, name, val);Value(key); } catch (e) {} if (typeof val !== 'string') { val = ''; @@ -5694,7 +5694,9 @@ _plugin('core', function(K) { } } else { //alert(data.message); - alert("浠呮敮鎸佸涓嬪浘鐗囨牸寮:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF"); +// alert("浠呮敮鎸佸涓嬪浘鐗囨牸寮:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF"); + var htmlvalue = "
    浠呮敮鎸佸涓嬪浘鐗囨牸寮:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF!

    "; + pop_up_box(htmlvalue,580,30,50); } }, afterError : function(str) { diff --git a/public/assets/kindeditor/pasteimg.js b/public/assets/kindeditor/pasteimg.js index 7165b142a..97d5e33c5 100644 --- a/public/assets/kindeditor/pasteimg.js +++ b/public/assets/kindeditor/pasteimg.js @@ -370,6 +370,9 @@ function df(myself) { else sstr += that.attr("src") + "|"; } + else if (that.attr("src").indexOf("data:image") >= 0){ + that.parents().removeAttr("href"); //鍒犻櫎鎵鏈夌埗鑺傜偣鐨刪ref + } } }); uploadpic(sstr,myself); @@ -397,7 +400,7 @@ function uploadpic(piclist,myself) { $.ajax({ url: "/kindeditor/uploadpic", data:{"pic":piclist}, - type: "GET", + type: "POST", beforeSend: function () { // $("#ajax-indicator span").text("鍥剧墖涓婁紶涓绋嶇瓑..."); keShadow(myself); diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index b9c8252e8..65c75d6ea 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -51,5 +51,6 @@ span.at {color:#269ac9;} span.at a{color:#269ac9;text-decoration: none;} /*yk*/ -.ke-content ol li{list-style-type: decimal;margin-left: 20px;} -.ke-content ul li{list-style-type: disc;margin-left: 20px;} \ No newline at end of file +.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 diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index f0f8e9c92..b4e582336 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -17,18 +17,18 @@
    - +
    - 杩熶氦鎵e垎锛歿{act.homework_common_detail.late_penalty}}鍒 鍖胯瘎寮鍚椂闂达細{{act.homework_common_detail.evaluation_start}}
    - 缂鸿瘎鎵e垎锛歿{act.homework_common_detail.absence_penalty}}鍒/浣滃搧 鍖胯瘎鍏抽棴鏃堕棿锛歿{act.homework_common_detail.evaluation_end}} + 杩熶氦鎵e垎锛歿{act.homework_common_detail.late_penalty}}鍒 鍖胯瘎寮鍚椂闂达細{{act.homework_common_detail.evaluation_start}}
    + 缂鸿瘎鎵e垎锛歿{act.homework_common_detail.absence_penalty}}鍒/浣滃搧 鍖胯瘎鍏抽棴鏃堕棿锛歿{act.homework_common_detail.evaluation_end}}
    鐐瑰嚮灞曞紑
    {{act.activity_type_name}} {{act.latest_update}} - - {{act.reply_count}} + + {{act.reply_count}}
    {{act.praise_count}}
    {{act.praise_count}}
    @@ -46,7 +46,7 @@
    - +
    @@ -54,8 +54,8 @@
    {{act.activity_type_name}} {{act.latest_update}} - - {{act.reply_count}} + + {{act.reply_count}}
    {{act.praise_count}}
    {{act.praise_count}}
    @@ -73,7 +73,7 @@
    - +
    @@ -81,8 +81,8 @@
    {{act.activity_type_name}} {{act.latest_update}} - - {{act.reply_count}} + + {{act.reply_count}}
    {{act.praise_count}}
    {{act.praise_count}}
    @@ -98,8 +98,8 @@
    - - + +
    @@ -116,7 +116,7 @@
    - +
    鐘舵侊細{{act.issue_detail.issue_status}} 浼樺厛绾э細{{act.issue_detail.issue_priority}}
    @@ -126,8 +126,8 @@
    {{act.activity_type_name}} {{act.latest_update}} - - {{act.reply_count}} + + {{act.reply_count}}
    {{act.praise_count}}
    {{act.praise_count}}
    @@ -146,7 +146,7 @@
    - +
    @@ -154,8 +154,8 @@
    {{act.activity_type_name}} {{act.latest_update}} - - {{act.reply_count}} + + {{act.reply_count}}
    {{act.praise_count}}
    {{act.praise_count}}
    @@ -170,8 +170,8 @@
    - - + +
    @@ -195,8 +195,8 @@ 鐐瑰嚮灞曞紑
    {{act.latest_update}} - - {{act.reply_count}} + + {{act.reply_count}}
    {{act.praise_count}}
    {{act.praise_count}}
    @@ -215,15 +215,15 @@
    - +
    鐐瑰嚮灞曞紑
    {{act.latest_update}} - - {{act.reply_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 c1133f955..514a2c94e 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -3,7 +3,7 @@
    -
    {{blog.title}}
    +
    {{blog.title}}      
    {{blog.user.realname}}鍙戣〃鍗氬
    @@ -32,13 +32,13 @@
    -
    +
    - +
    diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index e36fb3e27..d8c50364d 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -44,7 +44,7 @@
    - +
    diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index 3b7965733..c426f2794 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -44,7 +44,7 @@
    - +
    diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index fec0c4cff..1af5e185d 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -16,10 +16,10 @@
    - 杩熶氦鎵e垎锛歿{homework.late_penalty}}鍒
    - 缂鸿瘎鎵e垎锛歿{homework.absence_penalty}}鍒/浣滃搧
    - 鍖胯瘎寮鍚椂闂达細{{homework.evaluation_start}}
    - 鍖胯瘎鍏抽棴鏃堕棿锛歿{homework.evaluation_end}}
    + 杩熶氦鎵e垎锛歿{homework.late_penalty}}鍒
    + 缂鸿瘎鎵e垎锛歿{homework.absence_penalty}}鍒/浣滃搧
    + 鍖胯瘎寮鍚椂闂达細{{homework.evaluation_start}}
    + 鍖胯瘎鍏抽棴鏃堕棿锛歿{homework.evaluation_end}}
    {{homework.publish_time}} @@ -50,7 +50,7 @@
    - +
    diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index f61d803dd..950cbe18e 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -10,7 +10,7 @@ 鏉   婧愶細 - {{issue.project_name}}  |  椤圭洰缂洪櫡 + {{issue.project_name}}  |  椤圭洰闂
    @@ -48,7 +48,7 @@
    - +
    diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index 0bc87214b..29660e4fd 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -36,7 +36,7 @@
    - +
    diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 24ed8c9fc..7968ba5d7 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -44,7 +44,7 @@
    - +
    diff --git a/public/images/wechat/wechat_icon.png b/public/images/wechat/wechat_icon.png index cbc3eb565..7aa0a4351 100755 Binary files a/public/images/wechat/wechat_icon.png and b/public/images/wechat/wechat_icon.png differ diff --git a/public/images/wechat/wechat_icon2.png b/public/images/wechat/wechat_icon2.png new file mode 100755 index 000000000..cbc3eb565 Binary files /dev/null and b/public/images/wechat/wechat_icon2.png differ diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 112492a7e..aec0af070 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1287,3 +1287,75 @@ function description_showwords_ellipsis(id,num){ $("#intro_content_"+id).show(); } + +//by yk 寮规 value锛歨tml浠g爜鎴栬烦杞叾浠栭〉闈唬鐮 tWidth = 580 tTop=30 tLeft=50 +function pop_up_box(value,tWidth,tTop,tLeft){ + + if(!tWidth){ + var tWidth = 580; + } + + if(!tTop){ + var tTop = 30; + } + + if(!tLeft){ + var tLeft = 50; + } + + $("#ajax-modal").html(value); + showModal('ajax-modal', tWidth + "px"); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before(""); + $('#ajax-modal').parent().css("top", tTop+"%").css("left", tLeft+"%").css("padding-top", "10px").css("position", "fixed"); + $('#ajax-modal').parent().addClass("resourceUploadPopup"); + $('#ajax-modal').css("padding-left", "16px").css("padding-bottom", "16px"); + + function hideModal(){ + $('#ajax-modal').hide(); + } +} + +//yk 鑷姩璇嗗埆URL 骞跺姞涓婇摼鎺 +function autoUrl(id){ + if ($("#"+id).children().length > 0 ){ + $("#"+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) { + //娌℃湁://鐨勯兘鍔犱笂http:// + var reStr = full; + if (full.length > 0){ + if (full.indexOf("://") >= 0){ + reStr = ""+full+""; + } + else{ + reStr = ""+full+""; + } + } + return reStr ; + }); + $(this).html(html); + } + }); + } + 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) { + //娌℃湁://鐨勯兘鍔犱笂http:// + var reStr = full; + if (full.length > 0){ + if (full.indexOf("://") >= 0){ + reStr = ""+full+""; + } + else{ + reStr = ""+full+""; + } + } + return reStr ; + }); + $("#"+id).html(html); + } +} + + diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index 391774f0b..45d8de48b 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -11,11 +11,14 @@ $(function(){ var title = $('#program-title').val(); if (!src) { - alert('璇疯緭鍏ユ纭殑浠g爜'); + var htmlvalue = "
    璇疯緭鍏ユ纭殑浠g爜!

    "; + pop_up_box(htmlvalue,580,30,50); + return false; } if (!title) { - alert('璇疯緭鍏ユ爣棰'); + var htmlvalue = "
    璇疯緭鍏ユ爣棰!

    "; + pop_up_box(htmlvalue,580,30,50); return false; } return true; @@ -33,31 +36,6 @@ $(function(){ $('#test-program-btn').show(); return; } - /* - $.post( - '/student_work/program_test_ex', - {homework: homework_id, student_work_id: student_work_id, src: src, title: title, is_test: is_test}, - function(data,status){ - tested = true; - console.log(data); - if(data.index <=0){ - data.index = $('.ProResultTop').length+1; - } - - if (typeof cb == 'function') {cb(data); return;} - - var html=bt('t:result-list',data); - $('.ProResult').prepend(html); - - if (data.status==0 && is_test != 'true') { - var r=confirm("绛旈姝g‘锛屾槸鍚︾珛鍒绘彁浜?"); - if (r) { - $(".HomeWorkCon form").submit(); - } - } - } - ); - */ //鍏堟祴璇曚竴娆″苟杩斿洖娴嬭瘯闆嗕釜鏁板強缁撴灉鍐嶅垽鏂槸鍚﹂渶瑕佺户缁繘琛屾祴璇 var test_post = function(i, testid){ $.post( @@ -66,6 +44,22 @@ $(function(){ src: src, title: title, is_test: is_test,tIndex:i, testid: testid}, function(data,status){ + if (data.status==-4 || data.status==-5 ){ + //寮规 + var root_path = getRootPath(); + var forums_1_path = root_path + "/forums/1" + var htmlvalue = "
    鎮ㄧ殑绋嬪簭寮曞彂浜嗕笉鐭ュ悕寮傚父锛岃鍦ㄥ叕鍏辫创鍚ф彁浜ゆ偍鐨勪唬鐮佽繘琛屾剰瑙佸弽棣堬紝鎴戜滑澶勭悊鍚庝細绔嬪嵆鑱旂郴鎮紝璋㈣阿锛
    "; + pop_up_box(htmlvalue,580,30,50); + + $('#test-program-btn').show(); + return; + } + else if (data.status==-3){ + var htmlvalue = "
    瀵逛笉璧,鏈嶅姟鍣ㄧ箒蹇欒绋嶅悗鍐嶈瘯!

    "; + pop_up_box(htmlvalue,580,30,50); + $('#test-program-btn').show(); + return; + } var tSeq = data.tseq; var tCount = data.tcount; console.log("tSeq="+tSeq); @@ -81,10 +75,8 @@ $(function(){ if (data.status==0 && is_test != 'true') { if (typeof cb == 'function') {cb(data);$('#test-program-btn').show(); return;} - var r=confirm("绛旈姝g‘锛屾槸鍚︾珛鍒绘彁浜?"); - if (r) { - $(".HomeWorkCon form").submit(); - } + var htmlvalue = "
    绛旈姝g‘锛屾槸鍚︾珛鍒绘彁浜?

    "; + pop_up_box(htmlvalue,580,30,50); $('#test-program-btn').show(); return; } @@ -100,9 +92,11 @@ $(function(){ } ).fail(function(xhr, status){ if(status == 'timeout'){ - alert("鎮ㄧ殑绛旀瓒呮椂浜, 璇锋鏌ヤ唬鐮佹槸鍚﹀瓨鍦ㄦ寰幆鐨勯敊璇."); + var htmlvalue = "
    鎮ㄧ殑绛旀瓒呮椂浜, 璇锋鏌ヤ唬鐮佹槸鍚﹀瓨鍦ㄦ寰幆鐨勯敊璇!

    "; + pop_up_box(htmlvalue,580,30,50); } else { - alert("瀵逛笉璧,鏈嶅姟鍣ㄧ箒蹇欒绋嶅悗鍐嶈瘯!"); + var htmlvalue = "
    瀵逛笉璧,鏈嶅姟鍣ㄧ箒蹇欒绋嶅悗鍐嶈瘯!

    "; + pop_up_box(htmlvalue,580,30,50); } $('#test-program-btn').show(); return; @@ -120,20 +114,21 @@ $(function(){ return; } if($('.ProResult .ProResultTop').length<=0){ - var r=confirm("娴嬭瘯鍚庢墠鑳芥彁浜わ紝鏄惁绔嬪埢娴嬭瘯?"); - if (r) { + var htmlvalue = "
    娴嬭瘯鍚庢墠鑳芥彁浜わ紝鏄惁绔嬪埢娴嬭瘯?

    "; + pop_up_box(htmlvalue,580,30,50); + $("#code-test-button").on('click',function(){ test_program(); - } + hideModal(); + }); return; } - if (!tested) { test_program(function(data){ if (data.status!=0) { - var r=confirm("娴嬭瘯涓嶉氳繃锛屾槸鍚﹀己鍒舵彁浜?"); - if (!r) { - return; - } + var htmlvalue = "
    娴嬭瘯涓嶉氳繃锛屾槸鍚﹀己鍒舵彁浜?

    "; + pop_up_box(htmlvalue,580,30,50); + return; + }; $(".HomeWorkCon form").submit(); }); diff --git a/public/javascripts/init_KindEditor.js b/public/javascripts/init_KindEditor.js index f9b94e2d3..0f934e88e 100644 --- a/public/javascripts/init_KindEditor.js +++ b/public/javascripts/init_KindEditor.js @@ -1,5 +1,5 @@ function init_editor(params){ - // var minHeight; //鏈灏忛珮搴 + // var minHeight; //鏈灏忛珮搴 var paramsHeight = params.height; //璁惧畾鐨勯珮搴 var paramsWidth = params.width == undefined ? "100%" : params.width; @@ -7,7 +7,7 @@ function init_editor(params){ resizeType : 1,minWidth:"1px",width:paramsWidth, height:"30px",// == undefined ? "30px":paramsHeight+"px", minHeight:"30px",// == undefined ? "30px":paramsHeight+"px", - items:['emoticons'], + items:['emoticons'], afterChange:function(){//鎸夐敭浜嬩欢 nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); var edit = this.edit; @@ -49,6 +49,9 @@ function nh_check_field(params){ if(params.content.isEmpty()){ params.contentmsg.html('鍐呭涓嶈兘涓虹┖'); params.contentmsg.css({color:'#ff0000'}); + params.submit_btn.one('click', function(){ + params.form.submit(); + }); }else{ params.contentmsg.html('濉啓姝g‘'); params.contentmsg.css({color:'#008000'}); @@ -68,7 +71,9 @@ function init_form(params){ issubmit:true, content:params.editor, contentmsg:params.contentmsg, - textarea:params.textarea + textarea:params.textarea, + submit_btn:params.submit_btn, + form:params.form }); if(is_checked){ if(flag){ @@ -115,7 +120,7 @@ function init_KindEditor_data(id){ params.cancel_btn.click(function () { nh_reset_form(params); }); - params.submit_btn.click(function () { + params.submit_btn.one('click', function () { params.form.submit(); }); params.textarea.data('init', 1); diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 16fa8cf03..da314c5f5 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -128,12 +128,15 @@ app.factory('common', function($http, auth, $routeParams){ openid: auth.openid() }; + data.disabled = true; + $http({ method: 'POST', url: apiUrl+ "new_comment/"+id, data: userInfo }).then(function successCallback(response) { alert("鎻愪氦鎴愬姛"); + data.disabled = false; if(typeof cb === 'function'){ cb(); } @@ -416,7 +419,6 @@ app.directive('textAutoHeight', function($timeout){ $timeout(function(){ var e = element.parent().children().eq(5); var height = e[0].scrollHeight; - var offsetHeight = e[0].offsetHeight; if(height>90){ element.css('display', 'block'); element.on('click', function(){ diff --git a/public/plugin_assets/redmine_code_review/javascripts/code_review.js b/public/plugin_assets/redmine_code_review/javascripts/code_review.js index 4f4d81691..625f376c9 100644 --- a/public/plugin_assets/redmine_code_review/javascripts/code_review.js +++ b/public/plugin_assets/redmine_code_review/javascripts/code_review.js @@ -1,354 +1,354 @@ -/* -# Code Review plugin for Redmine -# Copyright (C) 2009-2013 Haruyuki Iida -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -var topZindex = 1000; -var action_type = ''; -var rev = ''; -var rev_to = ''; -var path = ''; -var urlprefix = ''; -var review_form_dialog = null; -var add_form_title = null; -var review_dialog_title = null; -var repository_id = null; -var filenames = []; - -var ReviewCount = function(total, open, progress){ - this.total = total; - this.open = open; - this.closed = total - open; - this.progress = progress -}; - -var CodeReview = function(id) { - this.id = id; - this.path = ''; - this.line = 0; - this.url = ''; - this.is_closed = false; -}; - -var review_counts = new Array(); -var code_reviews_map = new Array(); -var code_reviews_dialog_map = new Array(); - -function UpdateRepositoryView(title) { - var header = $("table.changesets thead tr:first"); - var th = $(''); - th.html(title); - header.append(th); - $('tr.changeset td.id a').each(function(i){ - var revision = this.getAttribute("href"); - revision = revision.substr(revision.lastIndexOf("/") + 1); - var review = review_counts['revision_' + revision]; - var td = $('',{ - 'class':'progress' - }); - td.html(review.progress); - $(this.parentNode.parentNode).append(td); - }); - } -//add function $.down -if(! $.fn.down) -(function($) { - $.fn.down = function() { - var el = this[0] && this[0].firstChild; - while (el && el.nodeType != 1) - el = el.nextSibling; - return $(el); - }; -})(jQuery); - -function UpdateRevisionView() { - $('li.change').each(function(){ - var li = $(this); - if (li.hasClass('folder')) return; - - var a = li.down('a'); - if (a.size() == 0) return; - var path = a.attr('href').replace(urlprefix, '').replace(/\?.*$/, ''); - - var reviewlist = code_reviews_map[path]; - if (reviewlist == null) return; - - var ul = $('
      '); - for (var j = 0; j < reviewlist.length; j++) { - var review = reviewlist[j]; - var icon = review.is_closed? 'icon-closed-review': 'icon-review'; - var item = $('
    • ', { - 'class': 'icon ' + icon + ' code_review_summary' - }); - item.html(review.url); - ul.append(item); - } - li.append(ul); - }); -} - -function setAddReviewButton(url, change_id, image_tag, is_readonly, is_diff, attachment_id){ - var filetables = []; - var j = 0; - $('table').each(function(){ - if($(this).hasClass('filecontent')){ - filetables[j++] = this; - } - }); - j = 0; - $('table.filecontent th.filename').each(function(){ - filenames[j] = $.trim($(this).text()); - j++; - }); - addReviewUrl = url + '?change_id=' + change_id + '&action_type=' + action_type + - '&rev=' + rev + '&rev_to=' + rev_to + - '&attachment_id=' + attachment_id + '&repository_id=' + encodeURIComponent(repository_id); - if (path != null && path.length > 0) { - addReviewUrl = addReviewUrl + '&path=' + encodeURIComponent(path); - } - var num = 0; - if (is_diff) { - num = 1; - } - var i, l, tl; - for (i = 0, tl = filetables.length; i < tl; i++) { - var table = filetables[i]; - var trs = table.getElementsByTagName('tr'); - - for (j = 0,l = trs.length; j < l; j++) { - var tr = trs[j]; - var ths = tr.getElementsByTagName('th'); - - var th = ths[num]; - if (th == null) { - continue; - } - - var th_html = th.innerHTML; - - var line = th_html.match(/[0-9]+/); - if (line == null) { - continue; - } - - var span_html = ''; - - if (!is_readonly) { - span_html += image_tag; - } - span_html += ''; - th.innerHTML = th_html + span_html; - - var img = th.getElementsByTagName('img')[0]; - if (img != null ) { - img.id = 'add_revew_img_' + line + '_' + i; - $(img).click(clickPencil); - } - } - } - - -} - -function clickPencil(e) -{ -// alert('$(e.target).attr("id") = ' + $(e.target).attr("id")); - var result = $(e.target).attr("id").match(/([0-9]+)_([0-9]+)/); - var line = result[1]; - var file_count = eval(result[2]); - var url = addReviewUrl + '&line=' + line + '&file_count=' + file_count; - - if (path == null || path.length == 0) { - url = url + '&path=' + encodeURIComponent(filenames[file_count]) + '&diff_all=true'; - } - addReview(url); - formPopup(e.pageX, e.pageY); - e.preventDefault(); -} -var addReviewUrl = null; -var showReviewUrl = null; -var showReviewImageTag = null; -var showClosedReviewImageTag = null; - -function setShowReviewButton(line, review_id, is_closed, file_count) { - //alert('file_count = ' + file_count); - var span = $('#review_span_' + line + '_' + file_count); - if (span.size() == 0) { - return; - } - var innerSpan = $('',{id: 'review_' + review_id}); - span.append(innerSpan); - innerSpan.html(is_closed? showClosedReviewImageTag : showReviewImageTag); - var div = $('
      ', { - 'class':'draggable', - id: 'show_review_' + review_id - }); - $('#code_review').append(div); - innerSpan.down('img').click(function(e) { - var review_id = $(e.target).parent().attr('id').match(/[0-9]+/)[0]; - var span = $('#review_' + review_id); // span element of view review button - var pos = span.offset(); - showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top + 25); - }); -} - -function popupReview(review_id) { - var span = $('#review_' + review_id); // span element of view review button - var pos = span.offset(); - $('html,body').animate({ scrollTop: pos.top }, - {duration: 'fast', - complete: function(){showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top)}}); - // position and show popup dialog - // create popup dialog - //var win = showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top); -// win.toFront(); -} - -function showReview(url, review_id, x, y) { - if (code_reviews_dialog_map[review_id] != null) { - var cur_win = code_reviews_dialog_map[review_id]; - cur_win.hide(); - code_reviews_dialog_map[review_id] = null; - } - $('#show_review_' + review_id).load(url, {review_id: review_id}); - var review = getReviewObjById(review_id); - - var win = $('#show_review_' + review_id).dialog({ - show: {effect:'scale'},// ? 'top-left' - //position: [x, y + 5], - width:640, - zIndex: topZindex, - title: review_dialog_title - }); -// win.getContent().style.color = "#484848"; -// win.getContent().style.background = "#ffffff"; - topZindex++; - code_reviews_dialog_map[review_id] = win; - return win -} - -function getReviewObjById(review_id) { - for (var reviewlist in code_reviews_map) { - for (var i = 0; i < reviewlist.length; i++) { - var review = reviewlist[i]; - if (review.id == review_id) { - return review; - } - } - } - return null; -} - -function formPopup(x, y){ - //@see http://docs.jquery.com/UI/Effects/Scale - var win = $('#review-form-frame').dialog({ - show: {effect:'scale', direction: 'both'},// ? 'top-left' -// position: [x, y + 5], - width:640, - zIndex: topZindex, - title: add_form_title - }); -// win.getContent().style.background = "#ffffff"; - if (review_form_dialog != null) { - review_form_dialog.destroy(); - review_form_dialog = null; - } - review_form_dialog = win; - topZindex += 10; - return false; -} - -function hideForm() { - if (review_form_dialog == null) { - return; - } - review_form_dialog.dialog('close'); - review_form_dialog = null; - $('#review-form').html(''); -} -function addReview(url) { - $('#review-form').load(url); -} - -function deleteReview(review_id) { - $('show_review_' + review_id).remove(); - $('review_' + review_id).remove(); - -} - -function changeImage(review_id, is_closed) { - var span = $('review_' + review_id); - var new_image = null; - var dummy = new Element('span'); - if (is_closed) { - dummy.insert(showClosedReviewImageTag); - } - else { - dummy.insert(showReviewImageTag); - } - new_image = dummy.down().getAttribute('src'); - //alert(new_image); - span.down('img').setAttribute('src', new_image); - -} - -function make_addreview_link(project, link) { - var alist = $('#content p a'); - if (alist == null) { - return; - } - var a = alist[0]; - var p = a.parentNode; - p.innerHTML = p.innerHTML + " | " + link; -} - -function call_update_revisions(url) { - var changeset_ids = ''; - var links = $$('table.changesets tbody tr.changeset td.id a'); - for (var i = 0; i < links.length; i++) { - var link = links[i]; - var href = link.getAttribute('href'); - var id = href.replace(/^.*\/revisions\//, ''); - if (i > 0) { - changeset_ids += ','; - } - changeset_ids += id; - } - new Ajax.Updater('code_review_revisions', url, - { - evalScripts:true, - method:'get', - parameters: 'changeset_ids=' + encodeURI(changeset_ids) - }); -} - -$.fn.serialize2json = function() -{ - var o = {}; - var a = this.serializeArray(); - $.each(a, function() { - if (o[this.name]) { - if (!o[this.name].push) { - o[this.name] = [o[this.name]]; - } - o[this.name].push(this.value || ''); - } else { - o[this.name] = this.value || ''; - } - }); - return o; +/* +# Code Review plugin for Redmine +# Copyright (C) 2009-2013 Haruyuki Iida +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +var topZindex = 1000; +var action_type = ''; +var rev = ''; +var rev_to = ''; +var path = ''; +var urlprefix = ''; +var review_form_dialog = null; +var add_form_title = null; +var review_dialog_title = null; +var repository_id = null; +var filenames = []; + +var ReviewCount = function(total, open, progress){ + this.total = total; + this.open = open; + this.closed = total - open; + this.progress = progress +}; + +var CodeReview = function(id) { + this.id = id; + this.path = ''; + this.line = 0; + this.url = ''; + this.is_closed = false; +}; + +var review_counts = new Array(); +var code_reviews_map = new Array(); +var code_reviews_dialog_map = new Array(); + +function UpdateRepositoryView(title) { + var header = $("table.changesets thead tr:first"); + var th = $(''); + th.html(title); + header.append(th); + $('tr.changeset td.id a').each(function(i){ + var revision = this.getAttribute("href"); + revision = revision.substr(revision.lastIndexOf("/") + 1); + var review = review_counts['revision_' + revision]; + var td = $('',{ + 'class':'progress' + }); + td.html(review.progress); + $(this.parentNode.parentNode).append(td); + }); + } +//add function $.down +if(! $.fn.down) +(function($) { + $.fn.down = function() { + var el = this[0] && this[0].firstChild; + while (el && el.nodeType != 1) + el = el.nextSibling; + return $(el); + }; +})(jQuery); + +function UpdateRevisionView() { + $('li.change').each(function(){ + var li = $(this); + if (li.hasClass('folder')) return; + + var a = li.down('a'); + if (a.size() == 0) return; + var path = a.attr('href').replace(urlprefix, '').replace(/\?.*$/, ''); + + var reviewlist = code_reviews_map[path]; + if (reviewlist == null) return; + + var ul = $('
        '); + for (var j = 0; j < reviewlist.length; j++) { + var review = reviewlist[j]; + var icon = review.is_closed? 'icon-closed-review': 'icon-review'; + var item = $('
      • ', { + 'class': 'icon ' + icon + ' code_review_summary' + }); + item.html(review.url); + ul.append(item); + } + li.append(ul); + }); +} + +function setAddReviewButton(url, change_id, image_tag, is_readonly, is_diff, attachment_id){ + var filetables = []; + var j = 0; + $('table').each(function(){ + if($(this).hasClass('filecontent')){ + filetables[j++] = this; + } + }); + j = 0; + $('table.filecontent th.filename').each(function(){ + filenames[j] = $.trim($(this).text()); + j++; + }); + addReviewUrl = url + '?change_id=' + change_id + '&action_type=' + action_type + + '&rev=' + rev + '&rev_to=' + rev_to + + '&attachment_id=' + attachment_id + '&repository_id=' + encodeURIComponent(repository_id); + if (path != null && path.length > 0) { + addReviewUrl = addReviewUrl + '&path=' + encodeURIComponent(path); + } + var num = 0; + if (is_diff) { + num = 1; + } + var i, l, tl; + for (i = 0, tl = filetables.length; i < tl; i++) { + var table = filetables[i]; + var trs = table.getElementsByTagName('tr'); + + for (j = 0,l = trs.length; j < l; j++) { + var tr = trs[j]; + var ths = tr.getElementsByTagName('th'); + + var th = ths[num]; + if (th == null) { + continue; + } + + var th_html = th.innerHTML; + + var line = th_html.match(/[0-9]+/); + if (line == null) { + continue; + } + + var span_html = ''; + + if (!is_readonly) { + span_html += image_tag; + } + span_html += ''; + th.innerHTML = th_html + span_html; + + var img = th.getElementsByTagName('img')[0]; + if (img != null ) { + img.id = 'add_revew_img_' + line + '_' + i; + $(img).click(clickPencil); + } + } + } + + +} + +function clickPencil(e) +{ +// alert('$(e.target).attr("id") = ' + $(e.target).attr("id")); + var result = $(e.target).attr("id").match(/([0-9]+)_([0-9]+)/); + var line = result[1]; + var file_count = eval(result[2]); + var url = addReviewUrl + '&line=' + line + '&file_count=' + file_count; + + if (path == null || path.length == 0) { + url = url + '&path=' + encodeURIComponent(filenames[file_count]) + '&diff_all=true'; + } + addReview(url); + formPopup(e.pageX, e.pageY); + e.preventDefault(); +} +var addReviewUrl = null; +var showReviewUrl = null; +var showReviewImageTag = null; +var showClosedReviewImageTag = null; + +function setShowReviewButton(line, review_id, is_closed, file_count) { + //alert('file_count = ' + file_count); + var span = $('#review_span_' + line + '_' + file_count); + if (span.size() == 0) { + return; + } + var innerSpan = $('',{id: 'review_' + review_id}); + span.append(innerSpan); + innerSpan.html(is_closed? showClosedReviewImageTag : showReviewImageTag); + var div = $('
        ', { + 'class':'draggable', + id: 'show_review_' + review_id + }); + $('#code_review').append(div); + innerSpan.down('img').click(function(e) { + var review_id = $(e.target).parent().attr('id').match(/[0-9]+/)[0]; + var span = $('#review_' + review_id); // span element of view review button + var pos = span.offset(); + showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top + 25); + }); +} + +function popupReview(review_id) { + var span = $('#review_' + review_id); // span element of view review button + var pos = span.offset(); + $('html,body').animate({ scrollTop: pos.top }, + {duration: 'fast', + complete: function(){showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top)}}); + // position and show popup dialog + // create popup dialog + //var win = showReview(showReviewUrl, review_id, pos.left + 10 + 5, pos.top); +// win.toFront(); +} + +function showReview(url, review_id, x, y) { + if (code_reviews_dialog_map[review_id] != null) { + var cur_win = code_reviews_dialog_map[review_id]; + cur_win.hide(); + code_reviews_dialog_map[review_id] = null; + } + $('#show_review_' + review_id).load(url, {review_id: review_id}); + var review = getReviewObjById(review_id); + + var win = $('#show_review_' + review_id).dialog({ + show: {effect:'scale'},// ? 'top-left' + //position: [x, y + 5], + width:640, + zIndex: topZindex, + title: review_dialog_title + }); +// win.getContent().style.color = "#484848"; +// win.getContent().style.background = "#ffffff"; + topZindex++; + code_reviews_dialog_map[review_id] = win; + return win +} + +function getReviewObjById(review_id) { + for (var reviewlist in code_reviews_map) { + for (var i = 0; i < reviewlist.length; i++) { + var review = reviewlist[i]; + if (review.id == review_id) { + return review; + } + } + } + return null; +} + +function formPopup(x, y){ + //@see http://docs.jquery.com/UI/Effects/Scale + var win = $('#review-form-frame').dialog({ + show: {effect:'scale', direction: 'both'},// ? 'top-left' +// position: [x, y + 5], + width:640, + zIndex: topZindex, + title: add_form_title + }); +// win.getContent().style.background = "#ffffff"; + if (review_form_dialog != null) { + review_form_dialog.destroy(); + review_form_dialog = null; + } + review_form_dialog = win; + topZindex += 10; + return false; +} + +function hideForm() { + if (review_form_dialog == null) { + return; + } + review_form_dialog.dialog('close'); + review_form_dialog = null; + $('#review-form').html(''); +} +function addReview(url) { + $('#review-form').load(url); +} + +function deleteReview(review_id) { + $('show_review_' + review_id).remove(); + $('review_' + review_id).remove(); + +} + +function changeImage(review_id, is_closed) { + var span = $('review_' + review_id); + var new_image = null; + var dummy = new Element('span'); + if (is_closed) { + dummy.insert(showClosedReviewImageTag); + } + else { + dummy.insert(showReviewImageTag); + } + new_image = dummy.down().getAttribute('src'); + //alert(new_image); + span.down('img').setAttribute('src', new_image); + +} + +function make_addreview_link(project, link) { + var alist = $('#content p a'); + if (alist == null) { + return; + } + var a = alist[0]; + var p = a.parentNode; + p.innerHTML = p.innerHTML + " | " + link; +} + +function call_update_revisions(url) { + var changeset_ids = ''; + var links = $$('table.changesets tbody tr.changeset td.id a'); + for (var i = 0; i < links.length; i++) { + var link = links[i]; + var href = link.getAttribute('href'); + var id = href.replace(/^.*\/revisions\//, ''); + if (i > 0) { + changeset_ids += ','; + } + changeset_ids += id; + } + new Ajax.Updater('code_review_revisions', url, + { + evalScripts:true, + method:'get', + parameters: 'changeset_ids=' + encodeURI(changeset_ids) + }); +} + +$.fn.serialize2json = function() +{ + var o = {}; + var a = this.serializeArray(); + $.each(a, function() { + if (o[this.name]) { + if (!o[this.name].push) { + o[this.name] = [o[this.name]]; + } + o[this.name].push(this.value || ''); + } else { + o[this.name] = this.value || ''; + } + }); + return o; }; \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index af22d6306..a55755740 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -47,7 +47,7 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} .hworkListRow:hover {background-color:#f6f6f7;} .hworkUl li{ float:left;} .hworkListRow li{ float:left;} -.hworkTip{position:absolute; padding:3px 5px; border:1px solid #eaeaea; display:block; right:-108px; top:20px; background-color:#ffffff; line-height:20px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);} +.hworkTip{position:absolute; padding:3px 5px; border:1px solid #eaeaea; display:block; right:-108px; top:-15px; background-color:#ffffff; line-height:20px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);} .hworkTip em {display:block; border-width:8px; position:absolute; bottom:4px; left:-16px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;} .hworkTip span {display:block; border-width:8px; position:absolute; bottom:4px; left:-15px; border-style:dashed solid dashed dashed; border-color:transparent #FFF transparent transparent; font-size:0; line-height:0;} .hworkList340 {width:335px; text-align:left; height:50px; line-height:50px;padding-left:5px;} @@ -59,6 +59,7 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} .hworkList100 {width:100px; text-align:center;} .hworkList130 {width:130px; text-align:center;} .hworkList160 {width:160px; text-align:center;} +.hworkList220 {width:220px; text-align:center;} .hworkList260 {width:260px; 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;} @@ -101,6 +102,10 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re .mt16{margin-top: 16px;} .pr10{padding-right: 10px;} +/*20160520浣滃搧鍒楄〃table*/ +.hwork-table-wrap {width:720px; border-collapse:collapse; vertical-align:middle;} +.hwork-table-wrap th {font-size:14px; color:#2d2d2d;} + /*浣滀笟淇℃伅*/ .mt-2 {margin-top:-2px;} .homeworkInfo {background:#F6F6F6; padding:10px; margin-bottom:10px;} @@ -139,8 +144,8 @@ a.postTypeGrey:hover {color:#269ac9;} .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;} .homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;} -.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.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;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} @@ -435,8 +440,8 @@ a:hover.ping_sub{ background:#14a8b9;} .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_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: 20px;} -.list_style ul li{list-style-type: disc;margin-left: 20px;} +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} span.author { font-size: 0.9em; color: #888; } /* 鍒涘缓浣滃搧 work */ @@ -563,6 +568,8 @@ a:hover.st_img { border:1px solid #1c9ec7; } a:hover.st_add{ color:#ff8e15;} .classbox_on{ border:1px solid #f8df8c; background:#f6f098; padding:0 3px; float:left; margin-left:15px;} .classbox_on a{ color:#716cad;} +.st_list_score {width:105px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; vertical-align:middle; font-size:12px; text-align:center;} + /* 鍒涘缓璇剧▼courses*/ .courses_input{ border:1px solid #64bdd9; height:16px; width:532px; background:#fff; margin-bottom:10px; padding:5px;} .courses_input_w{ width:300px;} @@ -1123,10 +1130,10 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} -.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} -.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.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;} -.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;} +.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;} .postDetailReply { margin-top:28px; color:#888888; float:right;} @@ -1244,10 +1251,12 @@ a:hover.blueCir{ background:#3598db; color:#fff;} .ml7 {margin-left:7px;} .tac {text-align:center;} .proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;} -.hworkPrName {width:160px; max-width:160px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:65px; line-height:65px; vertical-align:middle; font-size:12px; color:#888888; text-align:center;} +.hworkPrName {width:160px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:65px; line-height:65px; vertical-align:middle; font-size:12px; color:#888888; text-align:center;} +.hworkPrName2 {width:220px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:65px; line-height:65px; vertical-align:middle; font-size:12px; color:#888888; text-align:center;} .mr150 {margin-right:150px;} .relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} -.captainName {max-width:75px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;} +.captainName {max-width:65px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;} +.relatePImage {display:block; margin:0 auto;} /*涓婁紶璧勬簮寮圭獥*/ .resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index b740436f9..3e21a5fda 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -120,8 +120,8 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_distop span{ float:left;} .ping_distop p{ color:#5f5f5f;min-height: 24px;} .ping_disfoot a{ float:right; color:#15bccf; margin-left:5px;} -.list_style ol li{list-style-type: decimal;margin-left: 20px;} -.list_style ul li{list-style-type: disc;margin-left: 20px;} +.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;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 6082021af..cfdf12153 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -609,7 +609,7 @@ a.homepageMenuControl {float:left; width:180px;} .NewsBannerName {font-size:16px; color:#4b4b4b; display:block; width:150px; float:left;} .newsType {width:60px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-40px; font-size:12px; color:#888888; display:none; line-height:2; z-index:9999;} .newsReadSetting {width:700px; background-color:#f6f6f6; border-bottom:1px solid #eeeeee; margin:10px auto; height:39px; line-height:39px; vertical-align:middle; font-size:14px; color:#7a7a7a; padding-left:10px;} -.homepageNewsList {width:710px; height:49px; line-height:49px; vertical-align:middle; border-bottom:1px dashed #eaeaea; margin-left:10px;} +.homepageNewsList {width:710px; height:49px; line-height:49px; vertical-align:middle; border-bottom:1px dashed #eaeaea; } .homepageNewsPortrait {width:40px; display:block; margin-top:7px;} .homepageNewsPublisher { max-width:100px; font-size:12px; color:#269ac9; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; } .homepageNewsType {padding-left: 5px; font-size:12px; color:#888888; display:block;} @@ -637,6 +637,7 @@ a.replyGrey1:hover {color:#4b4b4b;} a.newsBlue {color:#269ac9;} a.newsBlue:hover {color:#297fb8;} a.newsBlack {color:#4b4b4b; font-size:13px; font-weight:bold} +span.newsBlack {color:#4b4b4b; font-size:13px; font-weight:bold} a.menuGrey {color:#808080;} a.menuGrey:hover {color:#fe7d68;} .navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #e1e1e1; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;} @@ -671,6 +672,7 @@ 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;} @@ -678,11 +680,11 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} .homepagePostReply {width:720px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;} -.homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;} -.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} -.borderBottomNone {border-bottom:none !important;} +.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;} +.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;} .borderBottomNone {border-bottom:none !important;} .topBorder {border-top: 1px solid #e4e4e4;} @@ -717,8 +719,9 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyDes {float:left; width:642px; margin-left:15px;} .homepagePostReplyPublisher {font-size:12px; color:#888888; margin-bottom:5px;} .homepagePostReplyContent {font-size:12px; color:#484848; margin:3px 5px 12px 5px;font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family:"寰蒋闆呴粦","瀹嬩綋";} -.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} +.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;} .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;} @@ -860,7 +863,10 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re .postDetailTitle {width:570px; max-width:570px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} -.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;} +.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;} +.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;} .postDetailReply { color:#888888; float:right;display: inline} @@ -1351,8 +1357,8 @@ a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-l a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} .link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} -.list_style ol li{list-style-type: decimal;margin-left: 20px;} -.list_style ul li{list-style-type: disc;margin-left: 20px;} +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} .ul_grey li {color:#909090; list-style-position:inside; padding-left:1px;list-style-image:url('../images/news_dot2.png')} .ul_normal_color li {list-style-position:inside; padding-left:1px; list-style-image:url('../images/news_dot.png')} span.author { font-size: 0.9em; color: #888; } @@ -1410,13 +1416,15 @@ a:hover.blueCir{ background:#3598db; color:#fff;} .proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;} .hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;} .mr150 {margin-right:150px;} -.captainName {max-width:75px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;} +.captainName {max-width:65px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;} /* @鍔熻兘 瀹氫箟 */ span.at {color:#269ac9;} span.at a{color:#269ac9;text-decoration: none;} .relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} +.relatePImage {display:block; margin:0 auto;} + /*闂鐘舵佸浘鐗*/ .issues{ background:url(../images/public_icon.png) -66px 5px no-repeat; width:18px; height:21px;} .duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:18px; height:21px;} @@ -1449,7 +1457,7 @@ span.at a{color:#269ac9;text-decoration: none;} .pic_edit2:hover{display:inline-block; background:url(../images/public_icon.png) -32px -32px no-repeat; width:20px; height:15px;} .w70{ width:70px;} .w80{ width:80px;} -.label03{ width:70px; text-align:right; display:block; float:left;} +.label03{ width:70px; text-align:right; display:block; float:left;white-space: nowrap;} .pro_info_p{color:#0781b4 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .proInfoP{color:#000000 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 515865f28..c5d6da994 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -122,7 +122,7 @@ div.flash {margin-top :0px !important} .w80{ width:80px;} .relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} -.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;} +.captainName {max-width:65px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;} .researchBox { width:240px; height:24px; border:1px solid #dddddd; color:#666666; outline:none;} .blueBtn{ width:60px; height:26px; color:#FFF; border:none; background-color:#269ac9; cursor:pointer; padding-left:0px; text-align:center;} .blueBtn:hover {background-color:#298fbd;} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 17977d46a..09f7075f7 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -220,8 +220,8 @@ a:hover.talk_btn{ background:#2a9dc1;} .mt0{ margin-top:0px;} .talk_info{ margin-left:60px; margin-top:10px;} /*.issue_desc li{list-style-type: decimal;margin-left: 20px;}*/ -.issue_desc ol li{list-style-type: decimal;margin-left: 20px;} -.issue_desc ul li{list-style-type: disc;margin-left: 20px;} +.issue_desc ol li{list-style-type: decimal;margin-left: 40px;} +.issue_desc ul li{list-style-type: disc;margin-left: 40px;} .talk_info img {max-width:100%;} a.talk_edit{ color:#426e9a; margin-right:5px;} a:hover.talk_edit{ color:#ff5722;} @@ -333,8 +333,8 @@ a:hover.ping_sub{ background:#14a8b9;} .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_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: 20px;} -.list_style ul li{list-style-type: disc;margin-left: 20px;} +.list_style ol li{list-style-type: decimal;margin-left: 40px;} +.list_style ul li{list-style-type: disc;margin-left: 40px;} /*涓婁紶璧勬簮寮瑰嚭妗嗘牱寮*/ .popbox_polls{position:fixed !important;} @@ -470,7 +470,7 @@ a:hover.st_add{ color:#ff8e15;} .newpro_box select{ height:29px; float:left; margin-bottom:10px;} /*.label{ width:80px; text-align:right; font-size:14 background-image: url(../images/true.png); }*/ .label02{ width:110px; text-align:right; font-size:14px; display:block; float:left;} -.label03{ width:70px; text-align:right; display:block; float:left;} +.label03{ width:70px; text-align:right; display:block; float:left;white-space: nowrap;} .collapsible{ border-left:none;border-right:none;border-bottom:none; border-top:1px solid #e4e4e4; padding-top:10px; } .icon-reload { background-image: url(../images/reload.png); } .icon { @@ -971,8 +971,8 @@ a:hover.Reply_pic{border:1px solid #64bdd9;} margin: 10px auto 0px; background-color: #F1F1F1; } -.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.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;} .topBorder { border-top: 1px solid #E4E4E4; @@ -1112,10 +1112,10 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;} .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} -.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} -.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.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;} -.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;} +.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;} .postDetailReply { margin-top:28px; color:#888888; float:right;} @@ -1240,4 +1240,4 @@ a.pages-big{ width:50px;} .pages{width:330px; margin:20px auto 10px;} .red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} -.green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} +.green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index ae77f380d..2ca221d5c 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -48,6 +48,7 @@ h4{ font-size:14px; color:#3b3b3b;} .fr{float:right;display:inline;} .f_l{ float:left;} .f_r{ float:right;} +.float-none {float:none !important;} .clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden} .clearfix{clear:both;zoom:1} .break_word{ word-break:break-all; word-wrap: break-word;} @@ -136,6 +137,8 @@ h4{ font-size:14px; color:#3b3b3b;} .pl10 {padding-left:10px;} .pl15{ padding-left:15px;} .pl5{ padding-left:5px;} +.pr5 {padding-right:5px;} +.pr10 {padding-right:10px;} .pt5{ padding-top:5px;} .pt10{ padding-top:10px;} .pb5{ padding-bottom: 5px;} @@ -605,8 +608,8 @@ a.postTypeGrey:hover {color:#269ac9;} .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;} .homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;} -.homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.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;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} @@ -641,8 +644,8 @@ a.postReplyCancel:hover {color:#ffffff;} .homepagePostReplyDes {float:left; width:620px; margin-left:15px;} .homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:5px;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} -.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} -.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} +.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;} .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;} @@ -1136,4 +1139,4 @@ a.st_down{ display: block; width:8px; float:left; height:13px; background:url(.. .likeNum{color: #7f7f7f} /*寮规*/ -.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-bottom:10px;} \ No newline at end of file +.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-bottom:10px;} diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index daa66d6bb..41084affa 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -49,7 +49,7 @@ a.underline {text-decoration:underline;} .fl {float:left;} .fr {float:right;} .cl {clear:both; overflow:hidden;} -.post-content {width:100%; font-size:13px; line-height:18px; height:90px; overflow:hidden; word-break:break-all; word-wrap:break-word;} +.post-content {width:100%; font-size:13px; 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, @@ -74,9 +74,9 @@ a.underline {text-decoration:underline;} /* 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;} -.loading-box {position:absolute; top:50%; background:white; width:160px; height:72px; left:50%; margin-top:-36px; margin-left:-80px; text-align:center;} +.loading-box {position:absolute; top:50%; background:rgba(240,240,240, 0.5); width:160px; height:72px; left:50%; margin-top:-36px; margin-left:-80px; text-align:center;} .loading-box img {margin-top: 3px; text-align: center;} .loading-box span {display: block; font-size:12px;} /*甯栧瓙閿佸畾鏍峰紡*/ -.locked_btn_cir {background: url("/images/locked.png") 0 0 no-repeat; cursor: default;} \ No newline at end of file +.locked_btn_cir {background: url("/images/locked.png") 0 0 no-repeat; cursor: default;}