From 6479ace5e16e70b5fd87b1ff281416784e7404c6 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 20 May 2016 16:19:10 +0800 Subject: [PATCH 01/76] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E7=9A=84=E5=BC=B9=E5=87=BA=E6=A1=86=E5=A2=9E=E5=8A=A0=E5=BA=8F?= =?UTF-8?q?=E5=8F=B7=E3=80=81=E5=AF=BC=E5=87=BA=E7=9A=84=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E5=8E=BB=E6=8E=89=E6=9C=AA=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E7=9A=84=E4=BD=9C=E4=B8=9A=E3=80=81=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- app/views/courses/_show_member_score.html.erb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 374e26431..17f62f18c 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -341,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| diff --git a/app/views/courses/_show_member_score.html.erb b/app/views/courses/_show_member_score.html.erb index 27b3863b0..80c2ef5cc 100644 --- a/app/views/courses/_show_member_score.html.erb +++ b/app/views/courses/_show_member_score.html.erb @@ -8,19 +8,19 @@ .tscore_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; text-align: center; padding-top:5px;} - .tscore_box{ width:350px; margin:15px auto;} + .tscore_box{ width:370px; margin:15px auto;} .tscore_box li{ height:25px;}

<%= @member_score.user.name %> 历次作业积分

-
+ + 删除
-
- 发送至 -
+ + +
选择 0 个资源
From dd4786d6390da2ed448426b5090878fda93a4ace Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 20 May 2016 20:44:13 +0800 Subject: [PATCH 13/76] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85=E5=AE=9A=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_student_table.html.erb | 2 +- app/views/student_work/_evaluation_un_work.html.erb | 2 +- app/views/student_work/_evaluation_work.html.erb | 2 +- public/stylesheets/courses.css | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/exercise/_student_table.html.erb b/app/views/exercise/_student_table.html.erb index 5a93c352a..979e711bc 100644 --- a/app/views/exercise/_student_table.html.erb +++ b/app/views/exercise/_student_table.html.erb @@ -65,7 +65,7 @@ <%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%> - 点击查看详情 +
<% 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 ba91589fa..9cac477ab 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -96,7 +96,7 @@ <% end%> - 点击查看详情 +
+ From 2afce9d56380706f57b889b450e5304698a0936b Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 23 May 2016 14:05:28 +0800 Subject: [PATCH 23/76] =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E7=94=B3=E8=AF=B7=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_show_user_homeworks.html.erb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/views/users/_show_user_homeworks.html.erb b/app/views/users/_show_user_homeworks.html.erb index 7e9df7f4d..46e075412 100644 --- a/app/views/users/_show_user_homeworks.html.erb +++ b/app/views/users/_show_user_homeworks.html.erb @@ -3,6 +3,8 @@
公共题库 我的题库 + +
<%=render :partial=>'homework_search_input', :locals=>{:type => @type,:is_import => 1} %>
@@ -43,11 +45,18 @@
From 6586dfaf916fc57cfd080080043555b82452d9df Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 23 May 2016 14:47:10 +0800 Subject: [PATCH 24/76] =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=A4=8D=E5=88=B6=E7=9A=84=E5=A7=93=E5=90=8D?= =?UTF-8?q?=E6=88=96=E5=AD=A6=E5=8F=B7=E6=88=96=E9=82=AE=E7=AE=B1=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E5=8C=85=E5=90=AB=E7=A9=BA=E6=A0=BC=EF=BC=8C=E8=80=8C?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=B8=8D=E5=88=B0=E7=9B=B8=E5=85=B3=E7=BB=93?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index f518f81da..dd178a1ce 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -374,7 +374,7 @@ class StudentWorkController < ApplicationController end end ################################################################################################################## - @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group] + @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name].to_s.strip || "",params[:group] @homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc") @all_homework_commons = @course.homework_commons.order("created_at desc") @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? From d70f42b4137d51b8c46d0d71052bb3e134868a76 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 23 May 2016 15:03:22 +0800 Subject: [PATCH 25/76] =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=B6=88=E6=81=AF=E5=BC=82=E6=AD=A5=E5=8F=91?= =?UTF-8?q?=E9=80=81=EF=BC=88=E6=B5=8B=E8=AF=95=E7=89=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/news.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/models/news.rb b/app/models/news.rb index a411ccaca..7131969a4 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -163,13 +163,13 @@ class News < ActiveRecord::Base end end - #课程/项目通知 消息发送 - #消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒 + # 课程/项目通知 消息发送 + # 消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒 def act_as_system_message 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.delay.send_message(m.user_id, self.course_id) count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count if count == 0 ws = WechatService.new @@ -189,6 +189,10 @@ class News < ActiveRecord::Base end end + def send_message user_id, course_id + self.course_messages << CourseMessage.new(:user_id => user_id, :course_id => course_id, :viewed => false) + end + # Time 2015-03-31 13:50:54 # Author lizanle # Description 删除news后删除对应的资源 From a3abf098419e77605be9b5f152553d2fef30b6f9 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 23 May 2016 16:04:06 +0800 Subject: [PATCH 26/76] =?UTF-8?q?delayjob=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/news.rb | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/models/news.rb b/app/models/news.rb index 7131969a4..beb58799f 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -167,17 +167,7 @@ class News < ActiveRecord::Base # 消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒 def act_as_system_message if self.course - self.course.members.each do |m| - if m.user_id != self.author_id - self.delay.send_message(m.user_id, self.course_id) - 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)}", content, format_time(self.created_on) - end - end - end + self.delay.send_message else if !self.project.nil? self.project.members.each do |m| @@ -189,8 +179,19 @@ class News < ActiveRecord::Base end end - def send_message user_id, course_id - self.course_messages << CourseMessage.new(:user_id => user_id, :course_id => course_id, :viewed => false) + def send_message + self.course.members.each do |m| + if m.user_id != self.author_id + self.course_messages << CourseMessage.new(:user_id => user_id, :course_id => container_id, :viewed => false) + # 微信相关 + 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)}", content, format_time(self.created_on) + end + end + end end # Time 2015-03-31 13:50:54 From e62a4cc64632a8985bc73c84679a4210aa8cdfbc Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 23 May 2016 16:29:38 +0800 Subject: [PATCH 27/76] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=85=AC=E4=BC=97=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/wechat_service.rb | 12 ++++++------ config/menu.yml | 2 +- config/wechat.yml | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb index 1dcd147d4..ee45c99dc 100644 --- a/app/services/wechat_service.rb +++ b/app/services/wechat_service.rb @@ -5,7 +5,7 @@ class WechatService data = { touser:openid, template_id:template_id, - url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", + url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", topcolor:"#FF0000", data:{ first: { @@ -44,7 +44,7 @@ class WechatService end Rails.logger.info "send over. #{req}" end - Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" + Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end def topic_publish_template(user_id, type, id, first, key1, key2, key3, remark="") @@ -59,7 +59,7 @@ class WechatService end Rails.logger.info "send over. #{req}" end - Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" + Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end def comment_template(user_id,type, id, first, key1, key2, key3, remark="") @@ -74,7 +74,7 @@ class WechatService end Rails.logger.info "send over. #{req}" end - Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" + Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end def message_update_template(user_id, type, id, first, key1, key2, remark="") @@ -83,7 +83,7 @@ class WechatService data = { touser:uw.openid, template_id:"YTyNPZnQD8uZFBFq-Q6cCOWaq5LA9vL6RFlF2JuD5Cg", - url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", + url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", topcolor:"#FF0000", data:{ first: { @@ -112,6 +112,6 @@ class WechatService end Rails.logger.info "send over. #{req}" end - Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" + Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end end \ No newline at end of file diff --git a/config/menu.yml b/config/menu.yml index 3951f836b..0c0e5c17d 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "最新动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/activities?response_type=code&scope=snsapi_base&state=123#wechat_redirect" + url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/activities?response_type=code&scope=snsapi_base&state=123#wechat_redirect" - type: "click" name: "意见反馈" diff --git a/config/wechat.yml b/config/wechat.yml index 5b528487b..53141df40 100644 --- a/config/wechat.yml +++ b/config/wechat.yml @@ -3,8 +3,8 @@ default: &default # corpsecret: "corpsecret" # agentid: 1 # Or if using public account, only need above two line - appid: "wxc09454f171153c2d" - secret: "dff5b606e34dcafe24163ec82c2715f8" + appid: "wx8e1ab05163a28e37" + secret: "beb4d3bc4b32b3557811680835357841" token: "123456" access_token: "1234567" encrypt_mode: false # if true must fill encoding_aes_key From b1c70db28a83d9147bfabd3bcab148a2fd7ab7e8 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 23 May 2016 16:34:31 +0800 Subject: [PATCH 28/76] =?UTF-8?q?=E4=B8=8A=E7=BA=BF=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/news.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/news.rb b/app/models/news.rb index 7131969a4..877d799bf 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -169,7 +169,7 @@ class News < ActiveRecord::Base if self.course self.course.members.each do |m| if m.user_id != self.author_id - self.delay.send_message(m.user_id, self.course_id) + # self.delay.send_message(m.user_id, self.course_id) count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count if count == 0 ws = WechatService.new @@ -189,9 +189,9 @@ class News < ActiveRecord::Base end end - def send_message user_id, course_id - self.course_messages << CourseMessage.new(:user_id => user_id, :course_id => course_id, :viewed => false) - end + # def send_message user_id, course_id + # self.course_messages << CourseMessage.new(:user_id => user_id, :course_id => course_id, :viewed => false) + # end # Time 2015-03-31 13:50:54 # Author lizanle From 2a0b35a1b393252ba1ad45df76f55b959b3d1312 Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 24 May 2016 09:38:49 +0800 Subject: [PATCH 29/76] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=A1=86=E9=AB=98=E5=BA=A6=E9=9A=8F=E6=96=87=E5=AD=97=E5=A2=9E?= =?UTF-8?q?=E5=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1234567 | 2 +- public/assets/wechat/blog_detail.html | 3 ++- public/assets/wechat/course_discussion.html | 3 ++- public/assets/wechat/course_notice.html | 3 ++- public/assets/wechat/homework_detail.html | 3 ++- public/assets/wechat/issue_detail.html | 3 ++- public/assets/wechat/jour_message_detail.html | 3 ++- public/assets/wechat/project_discussion.html | 3 ++- public/javascripts/wechat/app.js | 19 ++++++++++++++++++- public/stylesheets/weui/weixin.css | 3 ++- 10 files changed, 35 insertions(+), 10 deletions(-) diff --git a/1234567 b/1234567 index 3d4e13b55..f2f064de8 100644 --- a/1234567 +++ b/1234567 @@ -1 +1 @@ -{"access_token":"xAp1rQu0Xpv8CrlooZydXiyAQIqavONhB6FXnCl1Rw_nM-fyjUz-9foxqgkH2rPMwr5f1THUkzqxshoF3CZHjJM4CautpSlQ5e7MgkjF5-a8GB5gYCxtcdb5C1H2jyMgIOOcCGAPVV","expires_in":7200,"got_token_at":1463640239} \ No newline at end of file +{"access_token":"gRbIMUYYKFdANxpBGhYc8iauelCeSy3x7wODnZd1crF9upNiANKAdGaMKFLcgPz_0-oJvRtb7Ai0G1WnL_AnVV-tdRlzlCPpgpO9Z9k9EqrGz2iSLCAbQ35qk0f75KWlRRDfCEAVVH","expires_in":7200,"got_token_at":1464053170} \ No newline at end of file diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index 9f229699e..8473b1446 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -36,7 +36,8 @@
- + +
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 6466e12b8..c790fd5cf 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -42,7 +42,8 @@
- + +
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index c426f2794..18f62be1e 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -42,7 +42,8 @@
- + +
diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 1af5e185d..5efa7c54d 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -48,7 +48,8 @@
- + +
diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 950cbe18e..20c35c664 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -46,7 +46,8 @@
- + +
diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index 29660e4fd..f9aebd632 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -34,7 +34,8 @@
- + +
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 03fda04e5..0c3f9aad3 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -42,7 +42,8 @@
- + +
diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 7737a46dc..4c9ea260a 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -128,6 +128,7 @@ app.factory('common', function($http, auth, $routeParams){ openid: auth.openid() }; + //回复按钮禁用 data.disabled = true; $http({ @@ -136,6 +137,7 @@ app.factory('common', function($http, auth, $routeParams){ data: userInfo }).then(function successCallback(response) { alert("提交成功"); + //数据提交完成,回复按钮启用 data.disabled = false; if(typeof cb === 'function'){ cb(); @@ -402,6 +404,21 @@ app.directive('textAutoHeight', function($timeout){ } }); +app.directive('inputAuto',function(){ + return{ + restrict: 'A', + scope: {}, + link: function(scope, element){ + var copyContainer = element.parent().children().eq(0); + element.on('input',function(){ + copyContainer.html(element[0].value); + var textHeight = copyContainer[0].scrollHeight; + element.css('height', textHeight + 'px'); + }); + } + } +}); + app.directive('loadingSpinner', function ($http) { return { restrict: 'A', @@ -459,7 +476,7 @@ app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProv redirectTo: '/activities' }); - //监听异步请求 + //监听异步请求,实现加载中显隐标记 $httpProvider.interceptors.push(function ($q, $rootScope) { if ($rootScope.activeCalls == undefined) { $rootScope.activeCalls = 0; diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 47610d4c5..64598e381 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -66,7 +66,8 @@ a.underline {text-decoration:underline;} .post-reply-content img {max-width:100%;} .post-reply-date, .post-reply-trigger {font-size:13px;} .post-input-container {padding-right:2px;} -.post-reply-input {width:100%; height:28px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px;} +.copy-input {width:100%; height:28px; line-height:28px; border-radius:3px; position:absolute; left:-9999em;} +.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:hidden; resize:none;} .post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;} .reply-icon {background:url(/images/wechat/wechat_icon.png) -100px 1px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;} .praise-icon {background:url(/images/wechat/wechat_icon.png) -100px -38px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;} From 13676ec9c3eee6d62db3e862c8c3691e6d5af063 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 24 May 2016 09:51:27 +0800 Subject: [PATCH 30/76] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=9A=84=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/wechat_service.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb index ee45c99dc..6d8c0f234 100644 --- a/app/services/wechat_service.rb +++ b/app/services/wechat_service.rb @@ -5,7 +5,7 @@ class WechatService data = { touser:openid, template_id:template_id, - url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", + url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", topcolor:"#FF0000", data:{ first: { @@ -44,7 +44,6 @@ class WechatService end Rails.logger.info "send over. #{req}" end - Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end def topic_publish_template(user_id, type, id, first, key1, key2, key3, remark="") @@ -59,7 +58,6 @@ class WechatService end Rails.logger.info "send over. #{req}" end - Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end def comment_template(user_id,type, id, first, key1, key2, key3, remark="") @@ -74,7 +72,6 @@ class WechatService end Rails.logger.info "send over. #{req}" end - Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end def message_update_template(user_id, type, id, first, key1, key2, remark="") @@ -83,7 +80,7 @@ class WechatService data = { touser:uw.openid, template_id:"YTyNPZnQD8uZFBFq-Q6cCOWaq5LA9vL6RFlF2JuD5Cg", - url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", + url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect", topcolor:"#FF0000", data:{ first: { @@ -112,6 +109,5 @@ class WechatService end Rails.logger.info "send over. #{req}" end - Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end end \ No newline at end of file From bc0e24d39e421b37721ea4d38c75ea5d04bb3e13 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 24 May 2016 10:28:17 +0800 Subject: [PATCH 31/76] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 160 +++++++++--------- app/views/users/_resources_list.html.erb | 45 +---- .../users/_user_import_resource_list.html.erb | 16 +- app/views/users/_user_resource_info.html.erb | 10 +- .../users/_user_resource_tip_list.html.erb | 2 +- app/views/users/user_resource.html.erb | 6 +- 6 files changed, 96 insertions(+), 143 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2c4355180..853219426 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2058,18 +2058,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - elsif params[:type] == "2" - apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - if params[:status] == "2" - resource_type = "'Course'" - elsif params[:status] == "3" - resource_type = "'Project'" - elsif params[:status] == "5" - resource_type = "'Principal'" - else - resource_type = "'Project','OrgSubfield','Principal','Course'" - end - @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + # elsif params[:type] == "2" + # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # if params[:status] == "2" + # resource_type = "'Course'" + # elsif params[:status] == "3" + # resource_type = "'Project'" + # elsif params[:status] == "5" + # resource_type = "'Principal'" + # else + # resource_type = "'Project','OrgSubfield','Principal','Course'" + # end + # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @type = params[:type] @limit = 25 @@ -2211,18 +2211,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - elsif params[:type] == "2" - apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - if params[:status] == "2" - resource_type = "'Course'" - elsif params[:status] == "3" - resource_type = "'Project'" - elsif params[:status] == "5" - resource_type = "'Principal'" - else - resource_type = "'Project','OrgSubfield','Principal','Course'" - end - @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + # elsif params[:type] == "2" + # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # if params[:status] == "2" + # resource_type = "'Course'" + # elsif params[:status] == "3" + # resource_type = "'Project'" + # elsif params[:status] == "5" + # resource_type = "'Principal'" + # else + # resource_type = "'Project','OrgSubfield','Principal','Course'" + # end + # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @status = params[:status] @type = params[:type] @@ -2352,18 +2352,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - elsif params[:type] == "2" - apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - if params[:status] == "2" - resource_type = "'Course'" - elsif params[:status] == "3" - resource_type = "'Project'" - elsif params[:status] == "5" - resource_type = "'Principal'" - else - resource_type = "'Project','OrgSubfield','Principal','Course'" - end - @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + # elsif params[:type] == "2" + # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # if params[:status] == "2" + # resource_type = "'Course'" + # elsif params[:status] == "3" + # resource_type = "'Project'" + # elsif params[:status] == "5" + # resource_type = "'Principal'" + # else + # resource_type = "'Project','OrgSubfield','Principal','Course'" + # end + # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @type = params[:type] @limit = 25 @@ -2700,12 +2700,12 @@ class UsersController < ApplicationController # 获取公共资源 def get_public_resources user_course_ids, user_project_ids, order, score - attachments = Attachment.where("(is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}") + attachments = Attachment.where("(is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源搜索 def get_public_resources_search user_course_ids, user_project_ids, order, score, search - 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}") + attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的资源 @@ -2729,15 +2729,15 @@ class UsersController < ApplicationController and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}") end - # 获取我的私有资源分享结果 - def get_my_private_resources apply_ids, resource_type, order, score - attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type})").order("#{order.nil? ? 'created_on' : order} #{score}") - end - - # 获取我的私有资源分享搜索结果 - def get_my_private_resources_search apply_ids, resource_type, order, score, search - attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type}) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") - end + # # 获取我的私有资源分享结果 + # def get_my_private_resources apply_ids, resource_type, order, score + # attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type})").order("#{order.nil? ? 'created_on' : order} #{score}") + # end + # + # # 获取我的私有资源分享搜索结果 + # def get_my_private_resources_search apply_ids, resource_type, order, score, search + # attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type}) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + # end # 获取我的课程资源中搜索结果 def get_course_resources_search author_id, user_course_ids, order, score, search @@ -2748,12 +2748,12 @@ class UsersController < ApplicationController # 获取公共资源中课程资源 def get_course_resources_public user_course_ids, order, score - attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1)").order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1)").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源中课程资源搜索结果 def get_course_resources_public_search user_course_ids, order, score, search - attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的项目资源 @@ -2772,12 +2772,12 @@ class UsersController < ApplicationController # 获取公共资源的项目资源 def get_project_resources_public user_project_ids, order, score - attchments = Attachment.where("container_type = 'Project' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("container_type = 'Project' and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源的项目资源搜索 def get_project_resources_public_search user_project_ids, order, score, search - attchments = Attachment.where("(container_type = 'Project' and container_id is not null) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Project' and container_id is not null and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我上传的附件 @@ -2795,13 +2795,13 @@ class UsersController < ApplicationController # 获取公共资源中我上传的附件 def get_attch_resources_public order, score attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal') - and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") + and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源中我上传的附件 def get_attch_resources_public_search order, score, search attchments = Attachment.where("(container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal') - and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的用户类型资源 @@ -2816,12 +2816,12 @@ class UsersController < ApplicationController # 获取我的用户类型资源 def get_principal_resources_public order, score - attchments = Attachment.where("container_type = 'Principal' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("container_type = 'Principal' and is_public =1 and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的用户类型资源 def get_principal_resources_public_search order, score, search - attchments = Attachment.where("(container_type = 'Principal'and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Principal'and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") end # 资源库 分为全部 课程资源 项目资源 附件 @@ -2863,18 +2863,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - elsif params[:type] == "2" # 私有资源 - apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - if params[:status] == "2" - resource_type = "'Course'" - elsif params[:status] == "3" - resource_type = "'Project'" - elsif params[:status] == "5" - resource_type = "'Principal'" - else - resource_type = "'Project','OrgSubfield','Principal','Course'" - end - @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + # elsif params[:type] == "2" # 私有资源 + # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # if params[:status] == "2" + # resource_type = "'Course'" + # elsif params[:status] == "3" + # resource_type = "'Project'" + # elsif params[:status] == "5" + # resource_type = "'Principal'" + # else + # resource_type = "'Project','OrgSubfield','Principal','Course'" + # end + # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @status = params[:status] @type = params[:type] @@ -3054,19 +3054,19 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search) end - elsif params[:type] == "2" # 私有资源 - apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - if params[:status] == "2" - resource_type = "'Course'" - elsif params[:status] == "3" - resource_type = "'Project'" - elsif params[:status] == "5" - resource_type = "'Principal'" - else - resource_type = "'Project','OrgSubfield','Principal','Course'" - end - @attachments = get_my_private_resources_search(apply_ids, resource_type, @order, @score, search) - @attachments + # elsif params[:type] == "2" # 私有资源 + # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # if params[:status] == "2" + # resource_type = "'Course'" + # elsif params[:status] == "3" + # resource_type = "'Project'" + # elsif params[:status] == "5" + # resource_type = "'Principal'" + # else + # resource_type = "'Project','OrgSubfield','Principal','Course'" + # end + # @attachments = get_my_private_resources_search(apply_ids, resource_type, @order, @score, search) + # @attachments end @status = params[:status] @type = params[:type] diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index 3aaed7594..d22b69760 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -6,55 +6,20 @@ <% attachments.each do |attach| %>
  • - <% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> - - <% else %> - - <% end %> +
  • - <% 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 private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> - <% ah = attach.get_status_by_attach(User.current.id) %> - <% if ah.nil? %> - <%= link_to("请求分享", apply_resource_user_path(User.current.id, :attachment_id => attach.id), :class => 'green_btn_share c_white', :remote => true) %> - <% elsif ah == 1 %> - 等待回复 - <% elsif ah == 2 %> - 可引用 - <% elsif ah == 3 %> - 已拒绝 - <% end %> - <% else %> - <% ah = attach.get_status_by_attach(User.current.id) %> - <% if ah == 2 %> - 可引用 - <% else %> - -- - <% end %> - <% end %> + <%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack resource-list-middle hidden mw280' %>
  • <%= format_date(attach.created_on) %>
  • <%= attach.quotes.nil? ? 0 : attach.quotes %>
  • <%= attach.downloads %>
  • <%= attach.author_id %>
  • <%= (number_to_human_size(attach.filesize)).gsub("ytes", "") %>
  • - +
  • <%= get_resource_type(attach.container_type)%>
  • -
  • <%= private_attachment_allow(attach.id) %>
  • -
  • <%= attach.get_apply_resource_status(attach.id, User.current.id) %>
  • -
  • <%= private_attachment_allow(attach.id) ? 0 : 1 %>
  • <%= attach.id %>
@@ -219,7 +184,7 @@ } line.children().css("background-color", 'white'); id = line.children().last().html(); - user_id = line.children().eq(6).html(); + user_id = line.children().eq(5).html(); if(user_id === '<%= User.current.id%>') { if(line.children().first().children().data('hasHistory') == 'Y'){ alert('该资源存在历史版本,不能删除'); @@ -228,7 +193,7 @@ if (confirm('确定要删除资源"' + line.children().eq(1).children().attr('title').trim() + '"么?')) { $.ajax({ type: 'post', - url: '<%= user_resource_delete_user_path(User.current.id)%>' + '?resource_id=' + id + '&type=<%=@type %>&status=<%=@status %>' + url: '<%= user_resource_delete_user_path(User.current.id) %>' + '?resource_id=' + id + '&type=<%= @type %>&status=<%= @status %>' }); } diff --git a/app/views/users/_user_import_resource_list.html.erb b/app/views/users/_user_import_resource_list.html.erb index e8ed684c6..97366832b 100644 --- a/app/views/users/_user_import_resource_list.html.erb +++ b/app/views/users/_user_import_resource_list.html.erb @@ -6,22 +6,10 @@
  • <%= get_resource_type(attach.container_type)%>
  • diff --git a/app/views/users/_user_resource_info.html.erb b/app/views/users/_user_resource_info.html.erb index 52a61a7b0..a140f803c 100644 --- a/app/views/users/_user_resource_info.html.erb +++ b/app/views/users/_user_resource_info.html.erb @@ -19,13 +19,13 @@
    - + 全选 删除
- - - +
+ 发送至 +
选择 0 个资源
@@ -215,7 +215,7 @@ document.oncontextmenu = function() {return true;} line.children().css("background-color",'white'); id = line.children().last().html(); - user_id = line.children().eq(6).html(); + user_id = line.children().eq(5).html(); if(user_id === '<%= User.current.id %>') { res_name = line.children().eq(1).children().attr('title'); res_link = line.children().eq(1).html(); diff --git a/app/views/users/_user_resource_tip_list.html.erb b/app/views/users/_user_resource_tip_list.html.erb index 67fe292ee..35ca130dd 100644 --- a/app/views/users/_user_resource_tip_list.html.erb +++ b/app/views/users/_user_resource_tip_list.html.erb @@ -1,7 +1,7 @@
  • 资源名称
  • -
  • 操作
  • +
  • <%= link_to "上传时间", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "created_on", :search => " "), :class => "fl", :remote => true %> <% if @order == "created_on" %> diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb index 483dceaed..43f06b93d 100644 --- a/app/views/users/user_resource.html.erb +++ b/app/views/users/user_resource.html.erb @@ -55,9 +55,9 @@
  • 我的资源
  • -
  • - 申请资源 -
  • + + +
  •  
  • From ccf29c980a243dae60c0f16193c9c2ce4ee36bf9 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 24 May 2016 10:34:36 +0800 Subject: [PATCH 32/76] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=BD=9C=E4=B8=9A=EF=BC=9A=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=B8=AD=E5=8C=85=E6=8B=AC=E4=B8=8D=E5=8C=85?= =?UTF-8?q?=E5=90=AB=E5=85=B3=E9=94=AE=E5=AD=97=E7=9A=84=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E3=80=81=E4=BD=9C=E4=B8=9A=E5=9B=9E=E5=A4=8D=E6=A1=86=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E4=B8=8D=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 5 +++-- app/views/homework_common/_homework_index_list.html.erb | 8 ++++++++ app/views/homework_common/_homework_search_form.html.erb | 2 +- app/views/homework_common/index.html.erb | 9 ++------- app/views/homework_common/index.js.erb | 5 ++++- 5 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 app/views/homework_common/_homework_index_list.html.erb diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 9da4b90b9..376f8d5c2 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -14,6 +14,7 @@ class HomeworkCommonController < ApplicationController #unless params[:page] # update_homework_time(@course.homework_commons) #end + search = "%#{params[:search].to_s.strip.downcase}%" @new_homework = HomeworkCommon.new @new_homework.homework_detail_manual = HomeworkDetailManual.new @new_homework.course = @course @@ -21,10 +22,10 @@ class HomeworkCommonController < ApplicationController @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) if @is_teacher #@homeworks = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10) - @homework_commons = @course.homework_commons.order("created_at desc") + @homework_commons = @course.homework_commons.where("name like '%#{search}%'").order("created_at desc") else #@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10) - @homework_commons = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc") + @homework_commons = @course.homework_commons.where("name like '%#{search}%' and publish_time <= '#{Date.today}'").order("created_at desc") end @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) @is_new = params[:is_new] diff --git a/app/views/homework_common/_homework_index_list.html.erb b/app/views/homework_common/_homework_index_list.html.erb new file mode 100644 index 000000000..9b11017e8 --- /dev/null +++ b/app/views/homework_common/_homework_index_list.html.erb @@ -0,0 +1,8 @@ +<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:is_in_course => 1,:course_id => course_id} %> + +
    +
      + <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> +
    +
    +
    \ No newline at end of file diff --git a/app/views/homework_common/_homework_search_form.html.erb b/app/views/homework_common/_homework_search_form.html.erb index f71cec9a5..250d72467 100644 --- a/app/views/homework_common/_homework_search_form.html.erb +++ b/app/views/homework_common/_homework_search_form.html.erb @@ -1,4 +1,4 @@ -<%= form_tag( url_for(:controller => 'courses',:action => 'homework_search',:id=>course.id), +<%= form_tag( homework_common_index_url_in_org(course.id), :remote=>true ,:method => 'get',:class=>'resourcesSearchloadBox',:id=>'resource_search_form') do %> <%= submit_tag '',:class=>'homepageSearchIcon',:onfocus=>'this.blur();',:style=>'border-style:none' %> diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 29cff8933..35f4658f9 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -71,13 +71,8 @@ <% end%>
    <% end%> - <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homeworks,:page => 0,:is_in_course => 1,:course_id => @course.id} %> - -
    -
      - <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> -
    -
    +
    + <%= render :partial => 'homework_common/homework_index_list', :locals => {:homework_commons => @homeworks,:course_id => @course.id} %>
    diff --git a/app/views/homework_common/index.js.erb b/app/views/homework_common/index.js.erb index 7a038eb5c..4a9ec6ad3 100644 --- a/app/views/homework_common/index.js.erb +++ b/app/views/homework_common/index.js.erb @@ -1 +1,4 @@ -$("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id} )%>"); \ No newline at end of file +/* +$("#user_show_more_homework").replaceWith("<%#= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id} )%>");*/ + +$("#homework_index_list").html("<%=escape_javascript(render :partial => 'homework_common/homework_index_list', :locals => {:homework_commons => @homeworks,:course_id => @course.id}) %>"); From 29ceb7b8e961c76bb1942e7ef174e4441494ce4f Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 24 May 2016 15:01:26 +0800 Subject: [PATCH 33/76] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E6=B8=85=E6=99=B0=E9=97=AE=E9=A2=98=EF=BC=8C=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E7=82=B9=E8=B5=9E=E5=8F=B3=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/activities.html | 108 +++++++++++++------------- public/images/wechat/wechat_icon.gif | Bin 0 -> 2482 bytes public/images/wechat/wechat_icon.png | Bin 5631 -> 4259 bytes public/images/wechat/wechat_icon2.png | Bin 4259 -> 0 bytes public/javascripts/wechat/app.js | 54 ++++++------- public/stylesheets/weui/weixin.css | 9 ++- 6 files changed, 87 insertions(+), 84 deletions(-) create mode 100755 public/images/wechat/wechat_icon.gif delete mode 100755 public/images/wechat/wechat_icon2.png diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index b4e582336..3391506f2 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -23,15 +23,15 @@ 迟交扣分:{{act.homework_common_detail.late_penalty}}分 匿评开启时间:{{act.homework_common_detail.evaluation_start}}
    缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品 匿评关闭时间:{{act.homework_common_detail.evaluation_end}}
- 点击展开 +
- {{act.activity_type_name}} - {{act.latest_update}} - - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
+ {{act.activity_type_name}} + {{act.latest_update}} + + {{act.reply_count}} +
+
{{act.praise_count}}
+
{{act.praise_count}}
@@ -50,15 +50,15 @@
- 点击展开 +
- {{act.activity_type_name}} - {{act.latest_update}} - - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
+ {{act.activity_type_name}} + {{act.latest_update}} + + {{act.reply_count}} +
+
{{act.praise_count}}
+
{{act.praise_count}}
@@ -77,15 +77,15 @@
- 点击展开 +
- {{act.activity_type_name}} - {{act.latest_update}} - - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
+ {{act.activity_type_name}} + {{act.latest_update}} + + {{act.reply_count}} +
+
{{act.praise_count}}
+
{{act.praise_count}}
@@ -122,15 +122,15 @@ 状态:{{act.issue_detail.issue_status}} 优先级:{{act.issue_detail.issue_priority}}
指派给:{{act.issue_detail.issue_assigned_to}} 完成度:{{act.issue_detail.done_ratio}}% - 点击展开 +
- {{act.activity_type_name}} - {{act.latest_update}} - - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
+ {{act.activity_type_name}} + {{act.latest_update}} + + {{act.reply_count}} +
+
{{act.praise_count}}
+
{{act.praise_count}}
@@ -150,15 +150,15 @@
- 点击展开 +
- {{act.activity_type_name}} - {{act.latest_update}} - - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
+ {{act.activity_type_name}} + {{act.latest_update}} + + {{act.reply_count}} +
+
{{act.praise_count}}
+
{{act.praise_count}}
@@ -192,14 +192,14 @@

- 点击展开 +
- {{act.latest_update}} - - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
+ {{act.latest_update}} + + {{act.reply_count}} +
+
{{act.praise_count}}
+
{{act.praise_count}}
@@ -219,14 +219,14 @@
- 点击展开 +
- {{act.latest_update}} - - {{act.reply_count}} -
-
{{act.praise_count}}
-
{{act.praise_count}}
+ {{act.latest_update}} + + {{act.reply_count}} +
+
{{act.praise_count}}
+
{{act.praise_count}}
diff --git a/public/images/wechat/wechat_icon.gif b/public/images/wechat/wechat_icon.gif new file mode 100755 index 0000000000000000000000000000000000000000..8d460be806d4cadac2f3a1d9ce231aa13b206c04 GIT binary patch literal 2482 zcmaJ?dpwhEAKwfk5;_Q}nTqFe*oF-&=Q$P+(z%|@wh%kmCWj6(d33Op!|EwQR8q;g zIc3?>XygzP%PFTY6Us5q^j6RN$J={-?$3Q+hwu0M`~9x#`?+o>7e{joY!o0CFc=A# znwb+0O!kdTjePugtEhwduyyA1=YheYX5qLUy}Y2N_gTZ>+}!;5xTvYAxwB7{k&)5b z`ZhVgV{U#Cd7|XY?CkUE>KDy}!=f2p%ZPaL)8gV%*4?|V;g!9;{T=T*v6pN7;`wd8 z;;1`Ksi~>#(z5WBhPJouA%EA8Pkwp)I5(Humr>f8QTnd3@>vPLzoBzHKfmBm3~ym^ z@x{y9y;0A*dwL1XmsY{0!7M>v--o(af|$E4e_nXOY54F;P+wZt$FHq>$*+A@#VIZ+ zxmPKCkdxEdC2Z&zdCF#sCd3~{$IhfR3hEmgUN@D#8VpLTOL)>gH8q|4BroUTqgNec zH81(qT<*=AHx2QHU%!4WEG%03`t{=dH&vYHWn~rp9|mgMhGXxwOi$003kL6GW_q6G zR5cC@yL<9^J?*{YL&GCaxZSm_L**5fjg8Hb=}ndO{ST_%mpo->W@T}CH9}$cy?ghG zNp)jm<5}fhOG`^FEpG;ghKh=cmzS5dmlY1Uc|b5&I#%-CX&pwv;sObDh%dn}fMf}s zD6fJ-0`Qj5{YW>s8^xaBAK)B8CG3fC_r^s8;wSbMKuf6Y$^v91rahTTfFO-b3~_J-0)j#rAxx1d6v6;v3`ZEl z;F1Srh%iMXQD|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Y|NCsx&%zS+q zF6%qkw9)tV((OBsOJkH}e$6|gdI7&Y9#-xog=m0!= zl}~Xj1Ea0i?;w3f;OVmoY0%1*u{zJbt`E-U05lNO!JJF3VY&dIG`-1ILxJhRWg_$N z7lBIVdC@AP0-qP_Fz%kRr#dq@(#xylvzz$R9wHUHnB*{Qlo}l~3syUFqPJR2Cl5bUG?a_;-Q7^}fW^0l&Oi&TeFLaeH5R%;$8@JqWk zY=g0mZdR9HCv&7AJ1w3q_6()E&dbRjk8`fQd)3<}hV?E6zFqFBG9dA8;5^Vpdf#a^ zhP=+!bg)9jr+3w{8C$VY>o=wNjODBF0JlP|Y=90*dmJ^THWS JOO?kLr@HvizW^ zp1<@(><_F!QR(o#hoZ8vl2K8)xJG}XV!ADGqH@-?PfC8r`CA~FWGTtNJ-ArcW`o>v ztUv>V1Nxo9LQ-Uyd`zQw3Mf+mnUtyRYJ#)1oKpmvTTKN{@gFbf0%cSS0Xo3py#*L~ z7oG=|Yqq8f7K%032fb1SF~!cwra{w9pzBSkyxnF@xDrdzK(5*Ga2|aF!@S;<;ebOR zTR}L1R`tO^rdZ1J)DpNIlvu3Q5qX0Nw>cWgGzBBVz)w5m`IL)q0{6H{C6IAiPute< zcFXtpJQNGxA9}02suN^SsqUxx*#d7~7u$lhHYI7#57SQrHUs5*uA-G572ZC#X|Bd- zVXWvaX0Y+`Y$(FwLR{boN|;v)cH$3OV+ BY!(0j literal 0 HcmV?d00001 diff --git a/public/images/wechat/wechat_icon.png b/public/images/wechat/wechat_icon.png index 7aa0a4351c720ed5b5f10f056d2d1d14be1d05f6..cbc3eb565cc9ddd9ce1a9618becd0035d38f0919 100755 GIT binary patch literal 4259 zcmcIoX*iU9+m|ggp`k2^F^rvAVq(fNj2c9evM*zdrOc8U46=lXqAb}eL@Kg{DBDwdRqim5ivePr&&)xmJAKu>Mcs{(>ab4$sIex$2x%|)nmn+)b?9_ffaXvOSw*5v} zj0J1F%KD;sxLFpyfih(cVl+c*+Bvct%@5~I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6#eNwc>mo!9X&j7<#=`*dMV>&_{FNAU&kXSFyX@gx6s&BD&nUusNBqFS8C~ zN#Jr^?SN1T#hEEX<;8P;jeA%^o&<^Veki4gJwX74tq^=-rurs+|ebb?|y z3RwU0>Ivt))X5#>Li@HBIRQ{~LcyA#8Kl$N*Z=;JnUD&{F Xz08CkL8tv=#s=QLQIoHdHGBVmi>8p( diff --git a/public/images/wechat/wechat_icon2.png b/public/images/wechat/wechat_icon2.png deleted file mode 100755 index cbc3eb565cc9ddd9ce1a9618becd0035d38f0919..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4259 zcmcIoX*iU9+m|ggp`k2^F^rvAVq(fNj2c9evM*zdrOc8U46=lXqAb}eL@Kg{DBDwdRqim5ivePr&&)xmJAKu>Mcs{(>ab4$sIex$2x%|)nmn+)b?9_ffaXvOSw*5v} zj0J1F%KD;sxLFpyfih(cVl+c*+Bvct%@5~IU_-l-T?il}BF>#)LBP5CUv4FwU}NI| zdszw80D23^2&kRU2%jVG1*) z7!W)>u>szMa{*?S_<&1zEmyFv4(J3O#S$PAXgCm^=tZKU=-S}FbWyDNuWcw8^cRG7 zNgMp{psY>JK?Y=R0!Tycs45-?hl7wvHMqJ45(!rUAz*L>6vldys&I9b1`>rh2KxH} zv%Gn`x}hvEC;#@vT4{qlXfz563ib2zQ}a8jM)r1x!nL%terX^Osw{*m)t^Me(N#%Q zncoT+0u}G=Nuha?NuXbfI2W=HO&iRL^xr8EDgVflsDGD-_{s1Vpits>ta&{Ml&tqq@Sx#Df?++E)}dj%Z+k}FGQ;N1`9o#= z$M@aY)O|WVfB)Ff`JIr3+Mmx?1cHJFjDeRfg7Rk|wsN`V`f}-Rz6v?B@^NG7Ne6~} zruok%B=d%?#4EJQ3i1dVo_+JRtOJZ~IqETZm?^1?^3hwHx-cu{6bS3>FTba=C?kZl zi?^PO=&mL?){vNCeasQdpoUv@86Qh?UcGT^F9X!R^|?P+n%(!rk=aF)t7R@MX991v zy!~9Z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<Ou*bt;_@Z#+=KT46O*lm_pL+h>18sBi%z02EW4tT#r z&`Y!7J??lan};)XK-)P^@hi>Q#_iU^{mh#<&AL~JmE&;Fu80h-J9%~Tq7+>IU^k7~{<)y&Bsl21u(L%I4a z>PAU4^EYNz`=}B}iMqJZ)Y~K9Ru%Hh#CSpefILU044rvKK_A^4gknOc;72-%X_hY1 zpVow8h?iq`wHKxYnG%*(R+W!Qrus?a8_9WN#081LgF=S1pAYO>%xh0C(HFYP29K1~ zjWVwFze^mP*?A42oKMC~zjV?}7CTz6OR( nL>4EHap?cM!ES97vvII#bbG{qmhfHp_1nP6&90){ - element.css('display', 'block'); - element.on('click', function(){ - if(element.text() == "点击展开"){ - e.css("height", height+'px'); - element.text("点击隐藏"); - } else { - e.css("height", '90px'); - element.text("点击展开"); - } - - }); - } - }, false); - - } - } -}); +//app.directive('textAutoHeight', function($timeout){ +// return { +// restrict: 'A', +// scope: {}, +// link: function(scope, element, attr){ +// scope.text = '点击展开'; +// $timeout(function(){ +// var e = element.parent().children().eq(5); +// var height = e[0].scrollHeight; +// if(height>90){ +// element.css('display', 'block'); +// element.on('click', function(){ +// if(element.text() == "点击展开"){ +// e.css("height", height+'px'); +// element.text("点击隐藏"); +// } else { +// e.css("height", '90px'); +// element.text("点击展开"); +// } +// +// }); +// } +// }, false); +// +// } +// } +//}); app.directive('inputAuto',function(){ return{ diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 64598e381..8b135dbeb 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -8,6 +8,7 @@ h1,h2,h3,h4,h5,p {padding:0px; margin:0px;} .f13 {font-size:13px;} .f15 {font-size:15px;} .fb {font-weight:bold;} +.mt2 {margin-top:2px;} .mt5 {margin-top:5px;} .mt10 {margin-top:10px;} .mb5 {margin-bottom:5px;} @@ -16,6 +17,8 @@ h1,h2,h3,h4,h5,p {padding:0px; margin:0px;} .mr10 {margin-right:10px;} .ml15 {margin-left:15px;} .mr15 {margin-right:15px;} +.mr20 {margin-right:20px;} +.mr25 {margin-right:25px;} .ml55 {margin-left:55px;} .mr55 {margin-right:55px;} .c-blue {color:#269ac9;} @@ -69,9 +72,9 @@ a.underline {text-decoration:underline;} .copy-input {width:100%; height:28px; line-height:28px; border-radius:3px; position:absolute; left:-9999em;} .post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:hidden; resize:none;} .post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;} -.reply-icon {background:url(/images/wechat/wechat_icon.png) -100px 1px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;} -.praise-icon {background:url(/images/wechat/wechat_icon.png) -100px -38px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;} -.praised-icon {background:url(/images/wechat/wechat_icon.png) -100px -76px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;} +.reply-icon {background:url(/images/wechat/wechat_icon.gif) -100px 1px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.praise-icon {background:url(/images/wechat/wechat_icon.gif) -100px -38px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.praised-icon {background:url(/images/wechat/wechat_icon.gif) -100px -76px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} /* 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;} From 65c7719ed2d52524318e3e3c1ad6d257af9ab5f0 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 24 May 2016 15:18:11 +0800 Subject: [PATCH 34/76] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A4=A7=E7=BA=B2?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=9C=A8=E8=AE=A8=E8=AE=BA=E5=8C=BA=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_project_info.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb index 30f527595..c04c2effb 100644 --- a/app/views/layouts/_project_info.html.erb +++ b/app/views/layouts/_project_info.html.erb @@ -20,9 +20,9 @@
- +
- + <%= @course.name %> From 1c0a68e57b424c06f12397dde37c015e8ab01bad Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 24 May 2016 15:47:22 +0800 Subject: [PATCH 35/76] =?UTF-8?q?=E7=BB=84=E7=BB=87=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=88=90=E5=91=98tab=EF=BC=8C=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=A4=AA=E5=A4=9A=E5=AF=BC=E8=87=B4=E6=8D=A2=E9=A1=B5?= =?UTF-8?q?=E6=96=AD=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_member_list.html.erb | 2 +- public/stylesheets/org.css | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/organizations/_org_member_list.html.erb b/app/views/organizations/_org_member_list.html.erb index fb22716ff..0059a2be5 100644 --- a/app/views/organizations/_org_member_list.html.erb +++ b/app/views/organizations/_org_member_list.html.erb @@ -1,6 +1,6 @@ <% members.each do |member|%>
    -
  • <%= User.find(member.user_id).realname.blank? ? User.find(member.user_id).login : User.find(member.user_id).realname %>
  • +
  • <%= get_org_member_role_name member %> <%= form_for(member, {:as => :org_member, :remote => true, :url => Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s, diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index abfeaef85..f1b552687 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -18,14 +18,14 @@ .orgUrlInput {width:200px; outline:none; border:1px solid #eaeaea; height:22px;} a.saveBtn {padding:2px 10px; background-color:#269ac9; color:#ffffff;} a.saveBtn:hover {background-color:#297fb8;} -.orgMemberList {width:480px; float:left;} +.orgMemberList {width:420px; float:left;} .orgColumnList {width:688px; float:left;} .orgListUser {width:110px; float:left;padding-right: 10px;} .orgListRole {width:180px; float:left;} .orgOrder {width:70px; float:left; text-align:center;} .orgSubNum {width:30px; float:left; text-align:center;} .subNumBlock {cursor:pointer;background-color:#fffce6;color: #0d90c3; width:30px; height:17px; line-height:17px; margin:7px 0; vertical-align:middle;} -.orgMemContainer {width:208px;} +.orgMemContainer {width:268px;} .orgMemberAdd {float:right;} .orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;} .undis {display:none;} From a7a2be6a4bec789dc0e50ee6076dcac281fdaa28 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 24 May 2016 16:01:02 +0800 Subject: [PATCH 36/76] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 73 ++++++++++++------- app/views/users/_show_user_resource.html.erb | 15 ++-- .../users/_user_homework_attachment.html.erb | 2 +- app/views/users/user_import_resource.js.erb | 2 +- .../users/user_ref_resource_search.js.erb | 13 +++- 5 files changed, 68 insertions(+), 37 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 853219426..6f3cca744 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1022,20 +1022,34 @@ class UsersController < ApplicationController #用户从资源库导入资源到作业 def user_import_resource - @user = User.current - user_course_ids = @user.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 - @attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ - "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc") + if User.current.id.to_i != params[:id].to_i + render_403 + return + end + @resource_id = params[:project_id].nil? ? (params[:course_id].nil? ? params[:subfield_file_id] : params[:course_id]) : params[:project_id] + @resource_type = params[:project_id].nil? ? (params[:course_id].nil? ? "SubfieldFile" : "Course") : "Project" + @order, @b_sort = params[:order] || "created_on", params[:sort] || "asc" + @score = @b_sort == "desc" ? "asc" : "desc" + user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} + user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id } # user_org_ids = User.current.organizations.map {|o| o.id} + if(params[:type] == "1") # 我的资源 + # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 + @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score) + elsif (params[:type].blank? ||params[:type] == "6") # 公共资源 + # 公共资源库:所有公开资源或者我上传的私有资源 + @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) + end + @status = params[:status] @type = params[:type] @homework_id = params[:homework_id] - @limit = 7 + @limit = 10 @is_remote = true + @seleted_resources = session[:seleted_resource_ids].nil? ? [] : session[:seleted_resource_ids] @atta_count = @attachments.count @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1 @offset ||= @atta_pages.offset - @seleted_resources = session[:seleted_resource_ids].nil? ? [] : session[:seleted_resource_ids] #@curse_attachments_all = @all_attachments[@offset, @limit] - @attachments = paginateHelper @attachments,7 + @attachments = paginateHelper @attachments,10 respond_to do |format| format.js end @@ -1043,10 +1057,10 @@ class UsersController < ApplicationController #引入资源列表根据类型过滤 def user_resource_type - if User.current.id.to_i != params[:id].to_i - render_403 - return - end + # if User.current.id.to_i != params[:id].to_i + # render_403 + # return + # end user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id } # user_org_ids = User.current.organizations.map {|o| o.id} @@ -1095,22 +1109,27 @@ class UsersController < ApplicationController #引入资源列表根据关键词过滤 def user_ref_resource_search - search = params[:search].to_s.strip.downcase - if(params[:type].blank? || params[:type] == "1") #全部 - user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询 - @attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ - " or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))) and (filename like '%#{search}%') ").order("created_on desc") - elsif params[:type] == "2" #课程资源 + if User.current.id.to_i != params[:id].to_i + render_403 + return + end + @resource_id = params[:mul_id] + @resource_type = params[:mul_type] + @order, @b_sort = params[:order] || "created_on", params[:sort] || "asc" + @score = @b_sort == "desc" ? "asc" : "desc" + @user = User.current + @switch_search = params[:search].nil? ? " " : params[:search] + search = "%#{@switch_search.strip.downcase}%" + # 别人的资源库是没有权限去看的 + if(params[:type] == "1") # 我的资源 + # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} - @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like '%#{search}%') ").order("created_on desc") - elsif params[:type] == "3" #项目资源 - @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like '%#{search}%')").order("created_on desc") - elsif params[:type] == "4" #附件 - @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc") - elsif params[:type] == "5" #用户资源 - @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like '%#{search}%')").order("created_on desc") - elsif params[:type] == "6" #公共资源 - @attachments = Attachment.where("(is_public =1 and is_publish = 1 and container_id is not null)" + "or (author_id = #{params[:id]} and is_publish = 0)").order("created_on desc") + user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id } + # user_org_ids = User.current.organizations.map {|o| o.id} + @attachments = get_my_resources_search(params[:id], user_course_ids, user_project_ids, @order, @score, search) + elsif (params[:type].blank? || params[:type] == "6") # 公共资源 + # 公共资源库:所有公开资源或者我上传的私有资源 + @attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search) end @type = params[:type] @limit = 7 @@ -1120,7 +1139,7 @@ class UsersController < ApplicationController @offset ||= @atta_pages.offset @seleted_resources = session[:seleted_resource_ids].nil? ? [] : session[:seleted_resource_ids] #@curse_attachments_all = @all_attachments[@offset, @limit] - @attachments = paginateHelper @attachments,7 + @attachments = paginateHelper @attachments, 7 respond_to do |format| format.js end diff --git a/app/views/users/_show_user_resource.html.erb b/app/views/users/_show_user_resource.html.erb index 6c3216f11..f2c28387f 100644 --- a/app/views/users/_show_user_resource.html.erb +++ b/app/views/users/_show_user_resource.html.erb @@ -10,11 +10,16 @@ // }); $(document).ready(function(){ + <% if type == "1" %> + $("#my_resources_choose_homework").addClass("referenceTypeActive"); + $("#public_resources_choose_homework").removeClass("referenceTypeActive"); + <% else %> $(".referenceTypeBlock").click(function(){ var activeBlock = $(".referenceResourceType").children(".referenceTypeActive"); activeBlock.removeClass("referenceTypeActive"); $(this).addClass("referenceTypeActive"); }); + <% end %> }); // 点击 checkbox选中引用的资源的时候,保存该资源的id到session里去 @@ -36,14 +41,12 @@ function store_seleted_resource(dom){
- <%= form_tag(user_ref_resource_search_user_path(user),:method => 'get',:remote=>'true',:class=>'referenceSearchBox') do%> + <%= form_tag(user_ref_resource_search_user_path(user, :type => @type),:method => 'get',:remote=>'true',:class=>'referenceSearchBox') do%> <% end %> diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index 673cee0e1..9f9aea60f 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -70,7 +70,7 @@
上传附件 - <%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mt3 mr15",:title=>"请从资源库中选择文件作为作品的附件",:remote => true%> + <%= link_to "资源库",{:controller => 'users', :action => 'user_ref_resource_search', :id => User.current.id, :homework_id => container.id, :type => nil}, :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作品的附件", :remote => true %> <% if defined?(has_program) && has_program %>
编程 diff --git a/app/views/users/user_import_resource.js.erb b/app/views/users/user_import_resource.js.erb index 87324669e..cd302a9c1 100644 --- a/app/views/users/user_import_resource.js.erb +++ b/app/views/users/user_import_resource.js.erb @@ -1,4 +1,4 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_resource',:locals => {:user => @user,:homework_id=>@homework_id,:seleted_resources=>@seleted_resources}) %>'); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_resource',:locals => {:user => @user, :homework_id => @homework_id, :seleted_resources=> @seleted_resources, :type => @type}) %>'); showModal('ajax-modal', '730px'); $('#ajax-modal').css('height','500px').css("width","730px"); $('#ajax-modal').siblings().remove(); diff --git a/app/views/users/user_ref_resource_search.js.erb b/app/views/users/user_ref_resource_search.js.erb index 8651768a5..e6af1bc47 100644 --- a/app/views/users/user_ref_resource_search.js.erb +++ b/app/views/users/user_ref_resource_search.js.erb @@ -1,2 +1,11 @@ -$("#user_ref_resources").html('<%= escape_javascript(render :partial => 'homework_ref_resources_list',:locals=>{:attachments => @attachments,:seleted_resources=>@seleted_resources})%>'); -$("#resource_ref_pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); \ No newline at end of file +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_resource',:locals => {:user => @user, :homework_id => @homework_id, :seleted_resources=> @seleted_resources, :type => @type}) %>'); +showModal('ajax-modal', '730px'); +$('#ajax-modal').css('height','auto').css("width","730px"); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("
" + "
"); +$('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed"); +$('#ajax-modal').parent().addClass("popbox").addClass("referenceResourcesPopup"); + +$("#public_resources_choose_homework").attr('href','<%= user_ref_resource_search_user_path(@user, :type => '6') %>'); +$("#my_resources_choose_homework").attr('href','<%= user_ref_resource_search_user_path(@user, :type => '1') %>'); + From fc3b47e3aa556b454fc1d4c4f570dda7d79be673 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 24 May 2016 16:37:21 +0800 Subject: [PATCH 37/76] =?UTF-8?q?=E6=B5=8B=E9=AA=8C=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E7=9A=84js=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_student_table.html.erb | 61 +++++++++++----------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/app/views/exercise/_student_table.html.erb b/app/views/exercise/_student_table.html.erb index 3022b83a6..cbb56025e 100644 --- a/app/views/exercise/_student_table.html.erb +++ b/app/views/exercise/_student_table.html.erb @@ -15,46 +15,23 @@ - <% @exercise_users_list.each do |exercise|%> - - + <% @exercise_users_list.each_with_index do |exercise, index|%> - 1 + <%=index + 1 %> <%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;", :class => "mt15"),user_activities_path(exercise.user)) %> - + <%=exercise.user.show_name %> - + - + --   - + <% if exercise.created_at%> <%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>  <% if @exercise.end_time <= exercise.created_at %> @@ -67,5 +44,29 @@
- <% end%> + + + +<% end%> \ No newline at end of file From 7b7f9cf8f2b108777a974955fc62c8aecf97fb84 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 24 May 2016 19:52:51 +0800 Subject: [PATCH 38/76] =?UTF-8?q?=E5=88=A0=E9=99=A4wechat=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 1 - lib/wechat/bin/wechat | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 39be9cef3..7ee0552fb 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -178,7 +178,6 @@ class WechatsController < ActionController::Base openid: openid, user: user ) - request.reply.text "欢迎加入Trustie创新实践社区" render :json => {status:0, msg: "绑定成功"} rescue Exception=>e render :json => {status: -1, msg: e.message} diff --git a/lib/wechat/bin/wechat b/lib/wechat/bin/wechat index 8931a2dcb..d5563802e 100755 --- a/lib/wechat/bin/wechat +++ b/lib/wechat/bin/wechat @@ -1,3 +1,4 @@ +#coding=utf-8 #!/usr/bin/env ruby lib = File.expand_path(File.dirname(__FILE__) + '/../lib') From ed2f41394902fc09acfd56507fb3cd2453c918c7 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 24 May 2016 20:04:06 +0800 Subject: [PATCH 39/76] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 210 +++++++++--------- app/views/users/_resources_list.html.erb | 45 +++- .../users/_user_import_resource_list.html.erb | 22 +- app/views/users/_user_resource_info.html.erb | 14 +- .../users/_user_resource_tip_list.html.erb | 2 +- app/views/users/user_resource.html.erb | 14 +- 6 files changed, 177 insertions(+), 130 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 853219426..854e604b4 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -320,7 +320,7 @@ class UsersController < ApplicationController case params[:agree] when 'Y' ar.update_column('status', 2) - @msg.update_attributes(:apply_result => 1, :viewed => 1) + @msg.update_attributes(:apply_result => 1, :viewed => 1) ar.course_messages << CourseMessage.new(:user_id => ar.user_id, :course_id => -1, :viewed => false, :apply_result => 2, :status => 1) when 'N' ar.update_column('status', 3) @@ -539,28 +539,28 @@ class UsersController < ApplicationController end def student_homeworks - if User.current == @user - @page = params[:page] ? params[:page].to_i + 1 : 0 - user_course_ids = @user.courses.empty? ? "(-1)" :"(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" - - #判断当前用户在当前课程的身份 - visibleCourse = @user.courses.empty? ? [] : @user.courses.where("is_delete = 0").visible - homework_ids = [] - visibleCourse.each do |course| - homeworks = HomeworkCommon.where("course_id = #{course.id} and publish_time <= '#{Date.today}'") - homework_ids << homeworks.pluck(:id) unless homeworks.empty? - end - visible_homework_ids = homework_ids.size == 0 ? "(-1)" :"(" + homework_ids.join(",") + ")" - @homework_commons = HomeworkCommon.where("id in #{visible_homework_ids}").order("created_at desc").limit(10).offset(@page * 10) - @is_teacher = User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true) - @is_in_course = params[:is_in_course].to_i || 0 - respond_to do |format| - format.js - format.html {render :layout => 'new_base_user'} - end - else - render_403 + if User.current == @user + @page = params[:page] ? params[:page].to_i + 1 : 0 + user_course_ids = @user.courses.empty? ? "(-1)" :"(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" + + #判断当前用户在当前课程的身份 + visibleCourse = @user.courses.empty? ? [] : @user.courses.where("is_delete = 0").visible + homework_ids = [] + visibleCourse.each do |course| + homeworks = HomeworkCommon.where("course_id = #{course.id} and publish_time <= '#{Date.today}'") + homework_ids << homeworks.pluck(:id) unless homeworks.empty? + end + visible_homework_ids = homework_ids.size == 0 ? "(-1)" :"(" + homework_ids.join(",") + ")" + @homework_commons = HomeworkCommon.where("id in #{visible_homework_ids}").order("created_at desc").limit(10).offset(@page * 10) + @is_teacher = User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true) + @is_in_course = params[:is_in_course].to_i || 0 + respond_to do |format| + format.js + format.html {render :layout => 'new_base_user'} end + else + render_403 + end end def choose_user_course @@ -2058,18 +2058,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - # elsif params[:type] == "2" - # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - # if params[:status] == "2" - # resource_type = "'Course'" - # elsif params[:status] == "3" - # resource_type = "'Project'" - # elsif params[:status] == "5" - # resource_type = "'Principal'" - # else - # resource_type = "'Project','OrgSubfield','Principal','Course'" - # end - # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + elsif params[:type] == "2" + apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + if params[:status] == "2" + resource_type = "'Course'" + elsif params[:status] == "3" + resource_type = "'Project'" + elsif params[:status] == "5" + resource_type = "'Principal'" + else + resource_type = "'Project','OrgSubfield','Principal','Course'" + end + @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @type = params[:type] @limit = 25 @@ -2211,18 +2211,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - # elsif params[:type] == "2" - # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - # if params[:status] == "2" - # resource_type = "'Course'" - # elsif params[:status] == "3" - # resource_type = "'Project'" - # elsif params[:status] == "5" - # resource_type = "'Principal'" - # else - # resource_type = "'Project','OrgSubfield','Principal','Course'" - # end - # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + elsif params[:type] == "2" + apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + if params[:status] == "2" + resource_type = "'Course'" + elsif params[:status] == "3" + resource_type = "'Project'" + elsif params[:status] == "5" + resource_type = "'Principal'" + else + resource_type = "'Project','OrgSubfield','Principal','Course'" + end + @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @status = params[:status] @type = params[:type] @@ -2352,18 +2352,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - # elsif params[:type] == "2" - # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - # if params[:status] == "2" - # resource_type = "'Course'" - # elsif params[:status] == "3" - # resource_type = "'Project'" - # elsif params[:status] == "5" - # resource_type = "'Principal'" - # else - # resource_type = "'Project','OrgSubfield','Principal','Course'" - # end - # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + elsif params[:type] == "2" + apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + if params[:status] == "2" + resource_type = "'Course'" + elsif params[:status] == "3" + resource_type = "'Project'" + elsif params[:status] == "5" + resource_type = "'Principal'" + else + resource_type = "'Project','OrgSubfield','Principal','Course'" + end + @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @type = params[:type] @limit = 25 @@ -2700,12 +2700,12 @@ class UsersController < ApplicationController # 获取公共资源 def get_public_resources user_course_ids, user_project_ids, order, score - attachments = Attachment.where("(is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}") + attachments = Attachment.where("(is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源搜索 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 # 获取我的资源 @@ -2725,19 +2725,19 @@ class UsersController < ApplicationController # 获取我的课程资源 def get_course_resources author_id, user_course_ids, order, score attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+ - "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) + "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}") end - # # 获取我的私有资源分享结果 - # def get_my_private_resources apply_ids, resource_type, order, score - # attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type})").order("#{order.nil? ? 'created_on' : order} #{score}") - # end - # - # # 获取我的私有资源分享搜索结果 - # def get_my_private_resources_search apply_ids, resource_type, order, score, search - # attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type}) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") - # end + # 获取我的私有资源分享结果 + def get_my_private_resources apply_ids, resource_type, order, score + attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type})").order("#{order.nil? ? 'created_on' : order} #{score}") + end + + # 获取我的私有资源分享搜索结果 + def get_my_private_resources_search apply_ids, resource_type, order, score, search + attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type}) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + end # 获取我的课程资源中搜索结果 def get_course_resources_search author_id, user_course_ids, order, score, search @@ -2748,18 +2748,18 @@ class UsersController < ApplicationController # 获取公共资源中课程资源 def get_course_resources_public user_course_ids, order, score - attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1)").order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1)").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源中课程资源搜索结果 def get_course_resources_public_search user_course_ids, order, score, search - attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的项目资源 def get_project_resources author_id, user_project_ids, order, score attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+ - "or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) + "or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)").order("#{order.nil? ? 'created_on' : order} #{score}") end @@ -2772,12 +2772,12 @@ class UsersController < ApplicationController # 获取公共资源的项目资源 def get_project_resources_public user_project_ids, order, score - attchments = Attachment.where("container_type = 'Project' and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("container_type = 'Project' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源的项目资源搜索 def get_project_resources_public_search user_project_ids, order, score, search - attchments = Attachment.where("(container_type = 'Project' and container_id is not null and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Project' and container_id is not null) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我上传的附件 @@ -2795,13 +2795,13 @@ class UsersController < ApplicationController # 获取公共资源中我上传的附件 def get_attch_resources_public order, score attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal') - and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}") + and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源中我上传的附件 def get_attch_resources_public_search order, score, search attchments = Attachment.where("(container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal') - and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的用户类型资源 @@ -2816,12 +2816,12 @@ class UsersController < ApplicationController # 获取我的用户类型资源 def get_principal_resources_public order, score - attchments = Attachment.where("container_type = 'Principal' and is_public =1 and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("container_type = 'Principal' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的用户类型资源 def get_principal_resources_public_search order, score, search - attchments = Attachment.where("(container_type = 'Principal'and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Principal'and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") end # 资源库 分为全部 课程资源 项目资源 附件 @@ -2863,18 +2863,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - # elsif params[:type] == "2" # 私有资源 - # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - # if params[:status] == "2" - # resource_type = "'Course'" - # elsif params[:status] == "3" - # resource_type = "'Project'" - # elsif params[:status] == "5" - # resource_type = "'Principal'" - # else - # resource_type = "'Project','OrgSubfield','Principal','Course'" - # end - # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + elsif params[:type] == "2" # 私有资源 + apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + if params[:status] == "2" + resource_type = "'Course'" + elsif params[:status] == "3" + resource_type = "'Project'" + elsif params[:status] == "5" + resource_type = "'Principal'" + else + resource_type = "'Project','OrgSubfield','Principal','Course'" + end + @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @status = params[:status] @type = params[:type] @@ -3052,21 +3052,21 @@ class UsersController < ApplicationController @attachments = get_principal_resources_public_search(@order, @score, search) else # 公共资源库:所有公开资源或者我上传的私有资源 - @attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search) + @attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search) + end + elsif params[:type] == "2" # 私有资源 + apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + if params[:status] == "2" + resource_type = "'Course'" + elsif params[:status] == "3" + resource_type = "'Project'" + elsif params[:status] == "5" + resource_type = "'Principal'" + else + resource_type = "'Project','OrgSubfield','Principal','Course'" end - # elsif params[:type] == "2" # 私有资源 - # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - # if params[:status] == "2" - # resource_type = "'Course'" - # elsif params[:status] == "3" - # resource_type = "'Project'" - # elsif params[:status] == "5" - # resource_type = "'Principal'" - # else - # resource_type = "'Project','OrgSubfield','Principal','Course'" - # end - # @attachments = get_my_private_resources_search(apply_ids, resource_type, @order, @score, search) - # @attachments + @attachments = get_my_private_resources_search(apply_ids, resource_type, @order, @score, search) + @attachments end @status = params[:status] @type = params[:type] diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index d22b69760..3aaed7594 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -6,20 +6,55 @@ <% attachments.each do |attach| %>
  • - + <% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> + + <% else %> + + <% end %>
  • - <%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack resource-list-middle hidden mw280' %> + <% 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 private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> + <% ah = attach.get_status_by_attach(User.current.id) %> + <% if ah.nil? %> + <%= link_to("请求分享", apply_resource_user_path(User.current.id, :attachment_id => attach.id), :class => 'green_btn_share c_white', :remote => true) %> + <% elsif ah == 1 %> + 等待回复 + <% elsif ah == 2 %> + 可引用 + <% elsif ah == 3 %> + 已拒绝 + <% end %> + <% else %> + <% ah = attach.get_status_by_attach(User.current.id) %> + <% if ah == 2 %> + 可引用 + <% else %> + -- + <% end %> + <% end %>
  • <%= format_date(attach.created_on) %>
  • <%= attach.quotes.nil? ? 0 : attach.quotes %>
  • <%= attach.downloads %>
  • <%= attach.author_id %>
  • <%= (number_to_human_size(attach.filesize)).gsub("ytes", "") %>
  • - +
  • <%= get_resource_type(attach.container_type)%>
  • +
  • <%= private_attachment_allow(attach.id) %>
  • +
  • <%= attach.get_apply_resource_status(attach.id, User.current.id) %>
  • +
  • <%= private_attachment_allow(attach.id) ? 0 : 1 %>
  • <%= attach.id %>
@@ -184,7 +219,7 @@ } line.children().css("background-color", 'white'); id = line.children().last().html(); - user_id = line.children().eq(5).html(); + user_id = line.children().eq(6).html(); if(user_id === '<%= User.current.id%>') { if(line.children().first().children().data('hasHistory') == 'Y'){ alert('该资源存在历史版本,不能删除'); @@ -193,7 +228,7 @@ if (confirm('确定要删除资源"' + line.children().eq(1).children().attr('title').trim() + '"么?')) { $.ajax({ type: 'post', - url: '<%= user_resource_delete_user_path(User.current.id) %>' + '?resource_id=' + id + '&type=<%= @type %>&status=<%= @status %>' + url: '<%= user_resource_delete_user_path(User.current.id)%>' + '?resource_id=' + id + '&type=<%=@type %>&status=<%=@status %>' }); } diff --git a/app/views/users/_user_import_resource_list.html.erb b/app/views/users/_user_import_resource_list.html.erb index 97366832b..26118f3f4 100644 --- a/app/views/users/_user_import_resource_list.html.erb +++ b/app/views/users/_user_import_resource_list.html.erb @@ -1,15 +1,27 @@ <%= form_tag( url_for({:controller => 'users', :action => 'import_into_container', - :mul_id => @resource_id, - :mul_type => @resource_type}), - :method => 'post', :id => 'resource_import_container_form') do %> + :mul_id => @resource_id, + :mul_type => @resource_type}), + :method => 'post', :id => 'resource_import_container_form') do %> <% @attachments.each do |attach| %>
  • <%= get_resource_type(attach.container_type)%>
  • diff --git a/app/views/users/_user_resource_info.html.erb b/app/views/users/_user_resource_info.html.erb index a140f803c..9c321cdb5 100644 --- a/app/views/users/_user_resource_info.html.erb +++ b/app/views/users/_user_resource_info.html.erb @@ -1,6 +1,6 @@
    - <%= render :partial => "show_new_upload", :locals => {:type => @type, :status => @status} %> + <%= render :partial => "show_new_upload", :locals => {:type => @type, :status => @status} %>
    <%= render :partial => 'users/resource_search_form',:locals => {:user => @user, :type => @type, :order => @order, :sort => @score, :status => @status} %> @@ -19,13 +19,13 @@
    - 全选 + 删除
    -
    - 发送至 -
    + + +
    选择 0 个资源
    @@ -215,7 +215,7 @@ document.oncontextmenu = function() {return true;} line.children().css("background-color",'white'); id = line.children().last().html(); - user_id = line.children().eq(5).html(); + user_id = line.children().eq(6).html(); if(user_id === '<%= User.current.id %>') { res_name = line.children().eq(1).children().attr('title'); res_link = line.children().eq(1).html(); @@ -232,7 +232,7 @@ } } - //发送至按钮控制 + //发送至按钮控制 $("input[name='checkbox1[]']").click(function(){ if($("input[name='checkbox1[]']:checked").length >= 1){ $(".resourcesSelectSendButton").removeClass("inactive-border"); diff --git a/app/views/users/_user_resource_tip_list.html.erb b/app/views/users/_user_resource_tip_list.html.erb index 35ca130dd..67fe292ee 100644 --- a/app/views/users/_user_resource_tip_list.html.erb +++ b/app/views/users/_user_resource_tip_list.html.erb @@ -1,7 +1,7 @@
    • 资源名称
    • - +
    • 操作
    • <%= link_to "上传时间", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "created_on", :search => " "), :class => "fl", :remote => true %> <% if @order == "created_on" %> diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb index 43f06b93d..a8bd96859 100644 --- a/app/views/users/user_resource.html.erb +++ b/app/views/users/user_resource.html.erb @@ -8,11 +8,11 @@ } $(document).ready(function(){ - $(".resource-switch").click(function(){ - $(".resource-switch").children().removeClass("resource-tab-active"); - $(this).children().addClass("resource-tab-active"); - }); + $(".resource-switch").click(function(){ + $(".resource-switch").children().removeClass("resource-tab-active"); + $(this).children().addClass("resource-tab-active"); }); + }); function remote_search(){ $("#resource_search_form").submit(); } @@ -55,9 +55,9 @@
    • 我的资源
    • - - - +
    • + 申请资源 +
    •  
    • From 197f054c1896a3923fe828946f3157beab51c60d Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 09:10:41 +0800 Subject: [PATCH 40/76] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E7=A7=81=E6=9C=89=E8=B5=84=E6=BA=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 233 ++++++++---------- app/views/users/_resources_list.html.erb | 47 +--- .../users/_user_import_resource_list.html.erb | 16 +- app/views/users/_user_resource_info.html.erb | 10 +- .../users/_user_resource_tip_list.html.erb | 2 +- app/views/users/user_resource.html.erb | 6 +- 6 files changed, 124 insertions(+), 190 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1b85a4a20..203296160 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1022,34 +1022,20 @@ class UsersController < ApplicationController #用户从资源库导入资源到作业 def user_import_resource - if User.current.id.to_i != params[:id].to_i - render_403 - return - end - @resource_id = params[:project_id].nil? ? (params[:course_id].nil? ? params[:subfield_file_id] : params[:course_id]) : params[:project_id] - @resource_type = params[:project_id].nil? ? (params[:course_id].nil? ? "SubfieldFile" : "Course") : "Project" - @order, @b_sort = params[:order] || "created_on", params[:sort] || "asc" - @score = @b_sort == "desc" ? "asc" : "desc" - user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} - user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id } # user_org_ids = User.current.organizations.map {|o| o.id} - if(params[:type] == "1") # 我的资源 - # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 - @attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score) - elsif (params[:type].blank? ||params[:type] == "6") # 公共资源 - # 公共资源库:所有公开资源或者我上传的私有资源 - @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) - end - @status = params[:status] + @user = User.current + user_course_ids = @user.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 + @attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ + "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc") @type = params[:type] @homework_id = params[:homework_id] - @limit = 10 + @limit = 7 @is_remote = true - @seleted_resources = session[:seleted_resource_ids].nil? ? [] : session[:seleted_resource_ids] @atta_count = @attachments.count @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1 @offset ||= @atta_pages.offset + @seleted_resources = session[:seleted_resource_ids].nil? ? [] : session[:seleted_resource_ids] #@curse_attachments_all = @all_attachments[@offset, @limit] - @attachments = paginateHelper @attachments,10 + @attachments = paginateHelper @attachments,7 respond_to do |format| format.js end @@ -1057,10 +1043,10 @@ class UsersController < ApplicationController #引入资源列表根据类型过滤 def user_resource_type - # if User.current.id.to_i != params[:id].to_i - # render_403 - # return - # end + if User.current.id.to_i != params[:id].to_i + render_403 + return + end user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id } # user_org_ids = User.current.organizations.map {|o| o.id} @@ -1109,27 +1095,22 @@ class UsersController < ApplicationController #引入资源列表根据关键词过滤 def user_ref_resource_search - if User.current.id.to_i != params[:id].to_i - render_403 - return - end - @resource_id = params[:mul_id] - @resource_type = params[:mul_type] - @order, @b_sort = params[:order] || "created_on", params[:sort] || "asc" - @score = @b_sort == "desc" ? "asc" : "desc" - @user = User.current - @switch_search = params[:search].nil? ? " " : params[:search] - search = "%#{@switch_search.strip.downcase}%" - # 别人的资源库是没有权限去看的 - if(params[:type] == "1") # 我的资源 - # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 + search = params[:search].to_s.strip.downcase + if(params[:type].blank? || params[:type] == "1") #全部 + user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询 + @attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ + " or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))) and (filename like '%#{search}%') ").order("created_on desc") + elsif params[:type] == "2" #课程资源 user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} - user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id } - # user_org_ids = User.current.organizations.map {|o| o.id} - @attachments = get_my_resources_search(params[:id], user_course_ids, user_project_ids, @order, @score, search) - elsif (params[:type].blank? || params[:type] == "6") # 公共资源 - # 公共资源库:所有公开资源或者我上传的私有资源 - @attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search) + @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like '%#{search}%') ").order("created_on desc") + elsif params[:type] == "3" #项目资源 + @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like '%#{search}%')").order("created_on desc") + elsif params[:type] == "4" #附件 + @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc") + elsif params[:type] == "5" #用户资源 + @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like '%#{search}%')").order("created_on desc") + elsif params[:type] == "6" #公共资源 + @attachments = Attachment.where("(is_public =1 and is_publish = 1 and container_id is not null)" + "or (author_id = #{params[:id]} and is_publish = 0)").order("created_on desc") end @type = params[:type] @limit = 7 @@ -1139,7 +1120,7 @@ class UsersController < ApplicationController @offset ||= @atta_pages.offset @seleted_resources = session[:seleted_resource_ids].nil? ? [] : session[:seleted_resource_ids] #@curse_attachments_all = @all_attachments[@offset, @limit] - @attachments = paginateHelper @attachments, 7 + @attachments = paginateHelper @attachments,7 respond_to do |format| format.js end @@ -2077,18 +2058,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - elsif params[:type] == "2" - apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - if params[:status] == "2" - resource_type = "'Course'" - elsif params[:status] == "3" - resource_type = "'Project'" - elsif params[:status] == "5" - resource_type = "'Principal'" - else - resource_type = "'Project','OrgSubfield','Principal','Course'" - end - @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + # elsif params[:type] == "2" + # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # if params[:status] == "2" + # resource_type = "'Course'" + # elsif params[:status] == "3" + # resource_type = "'Project'" + # elsif params[:status] == "5" + # resource_type = "'Principal'" + # else + # resource_type = "'Project','OrgSubfield','Principal','Course'" + # end + # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @type = params[:type] @limit = 25 @@ -2230,18 +2211,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - elsif params[:type] == "2" - apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - if params[:status] == "2" - resource_type = "'Course'" - elsif params[:status] == "3" - resource_type = "'Project'" - elsif params[:status] == "5" - resource_type = "'Principal'" - else - resource_type = "'Project','OrgSubfield','Principal','Course'" - end - @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + # elsif params[:type] == "2" + # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # if params[:status] == "2" + # resource_type = "'Course'" + # elsif params[:status] == "3" + # resource_type = "'Project'" + # elsif params[:status] == "5" + # resource_type = "'Principal'" + # else + # resource_type = "'Project','OrgSubfield','Principal','Course'" + # end + # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @status = params[:status] @type = params[:type] @@ -2371,18 +2352,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - elsif params[:type] == "2" - apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - if params[:status] == "2" - resource_type = "'Course'" - elsif params[:status] == "3" - resource_type = "'Project'" - elsif params[:status] == "5" - resource_type = "'Principal'" - else - resource_type = "'Project','OrgSubfield','Principal','Course'" - end - @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + # elsif params[:type] == "2" + # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # if params[:status] == "2" + # resource_type = "'Course'" + # elsif params[:status] == "3" + # resource_type = "'Project'" + # elsif params[:status] == "5" + # resource_type = "'Principal'" + # else + # resource_type = "'Project','OrgSubfield','Principal','Course'" + # end + # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @type = params[:type] @limit = 25 @@ -2719,12 +2700,12 @@ class UsersController < ApplicationController # 获取公共资源 def get_public_resources user_course_ids, user_project_ids, order, score - attachments = Attachment.where("(is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}") + attachments = Attachment.where("(is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源搜索 def get_public_resources_search user_course_ids, user_project_ids, order, score, search - 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}") + attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的资源 @@ -2748,15 +2729,15 @@ class UsersController < ApplicationController and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}") end - # 获取我的私有资源分享结果 - def get_my_private_resources apply_ids, resource_type, order, score - attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type})").order("#{order.nil? ? 'created_on' : order} #{score}") - end - - # 获取我的私有资源分享搜索结果 - def get_my_private_resources_search apply_ids, resource_type, order, score, search - attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type}) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") - end + # # 获取我的私有资源分享结果 + # def get_my_private_resources apply_ids, resource_type, order, score + # attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type})").order("#{order.nil? ? 'created_on' : order} #{score}") + # end + # + # # 获取我的私有资源分享搜索结果 + # def get_my_private_resources_search apply_ids, resource_type, order, score, search + # attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type}) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + # end # 获取我的课程资源中搜索结果 def get_course_resources_search author_id, user_course_ids, order, score, search @@ -2767,12 +2748,12 @@ class UsersController < ApplicationController # 获取公共资源中课程资源 def get_course_resources_public user_course_ids, order, score - attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1)").order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1)").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源中课程资源搜索结果 def get_course_resources_public_search user_course_ids, order, score, search - attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的项目资源 @@ -2791,12 +2772,12 @@ class UsersController < ApplicationController # 获取公共资源的项目资源 def get_project_resources_public user_project_ids, order, score - attchments = Attachment.where("container_type = 'Project' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("container_type = 'Project' and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源的项目资源搜索 def get_project_resources_public_search user_project_ids, order, score, search - attchments = Attachment.where("(container_type = 'Project' and container_id is not null) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Project' and container_id is not null and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我上传的附件 @@ -2814,13 +2795,13 @@ class UsersController < ApplicationController # 获取公共资源中我上传的附件 def get_attch_resources_public order, score attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal') - and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") + and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取公共资源中我上传的附件 def get_attch_resources_public_search order, score, search attchments = Attachment.where("(container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal') - and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的用户类型资源 @@ -2835,12 +2816,12 @@ class UsersController < ApplicationController # 获取我的用户类型资源 def get_principal_resources_public order, score - attchments = Attachment.where("container_type = 'Principal' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("container_type = 'Principal' and is_public =1 and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的用户类型资源 def get_principal_resources_public_search order, score, search - attchments = Attachment.where("(container_type = 'Principal'and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + attchments = Attachment.where("(container_type = 'Principal'and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") end # 资源库 分为全部 课程资源 项目资源 附件 @@ -2882,18 +2863,18 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) end - elsif params[:type] == "2" # 私有资源 - apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - if params[:status] == "2" - resource_type = "'Course'" - elsif params[:status] == "3" - resource_type = "'Project'" - elsif params[:status] == "5" - resource_type = "'Principal'" - else - resource_type = "'Project','OrgSubfield','Principal','Course'" - end - @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + # elsif params[:type] == "2" # 私有资源 + # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # if params[:status] == "2" + # resource_type = "'Course'" + # elsif params[:status] == "3" + # resource_type = "'Project'" + # elsif params[:status] == "5" + # resource_type = "'Principal'" + # else + # resource_type = "'Project','OrgSubfield','Principal','Course'" + # end + # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) end @status = params[:status] @type = params[:type] @@ -3073,19 +3054,19 @@ class UsersController < ApplicationController # 公共资源库:所有公开资源或者我上传的私有资源 @attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search) end - elsif params[:type] == "2" # 私有资源 - apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - if params[:status] == "2" - resource_type = "'Course'" - elsif params[:status] == "3" - resource_type = "'Project'" - elsif params[:status] == "5" - resource_type = "'Principal'" - else - resource_type = "'Project','OrgSubfield','Principal','Course'" - end - @attachments = get_my_private_resources_search(apply_ids, resource_type, @order, @score, search) - @attachments + # elsif params[:type] == "2" # 私有资源 + # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # if params[:status] == "2" + # resource_type = "'Course'" + # elsif params[:status] == "3" + # resource_type = "'Project'" + # elsif params[:status] == "5" + # resource_type = "'Principal'" + # else + # resource_type = "'Project','OrgSubfield','Principal','Course'" + # end + # @attachments = get_my_private_resources_search(apply_ids, resource_type, @order, @score, search) + # @attachments end @status = params[:status] @type = params[:type] diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index 3aaed7594..26e8f922b 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -6,55 +6,20 @@ <% attachments.each do |attach| %>
      • - <% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> - - <% else %> - - <% end %> +
      • - <% 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 private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> - <% ah = attach.get_status_by_attach(User.current.id) %> - <% if ah.nil? %> - <%= link_to("请求分享", apply_resource_user_path(User.current.id, :attachment_id => attach.id), :class => 'green_btn_share c_white', :remote => true) %> - <% elsif ah == 1 %> - 等待回复 - <% elsif ah == 2 %> - 可引用 - <% elsif ah == 3 %> - 已拒绝 - <% end %> - <% else %> - <% ah = attach.get_status_by_attach(User.current.id) %> - <% if ah == 2 %> - 可引用 - <% else %> - -- - <% end %> - <% end %> + <%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack resource-list-middle hidden mw280' %>
      • <%= format_date(attach.created_on) %>
      • <%= attach.quotes.nil? ? 0 : attach.quotes %>
      • <%= attach.downloads %>
      • <%= attach.author_id %>
      • <%= (number_to_human_size(attach.filesize)).gsub("ytes", "") %>
      • - +
      • <%= get_resource_type(attach.container_type)%>
      • -
      • <%= private_attachment_allow(attach.id) %>
      • -
      • <%= attach.get_apply_resource_status(attach.id, User.current.id) %>
      • -
      • <%= private_attachment_allow(attach.id) ? 0 : 1 %>
      • <%= attach.id %>
      @@ -104,7 +69,7 @@ document.oncontextmenu = function() {return true;} line.children().css("background-color",'white'); id = line.children().last().html(); - user_id = line.children().eq(6).html(); + user_id = line.children().eq(5).html(); allow = line.children().eq(13).html(); if( allow == 0){ alert('您无权发送私有资源') @@ -219,7 +184,7 @@ } line.children().css("background-color", 'white'); id = line.children().last().html(); - user_id = line.children().eq(6).html(); + user_id = line.children().eq(5).html(); if(user_id === '<%= User.current.id%>') { if(line.children().first().children().data('hasHistory') == 'Y'){ alert('该资源存在历史版本,不能删除'); @@ -228,7 +193,7 @@ if (confirm('确定要删除资源"' + line.children().eq(1).children().attr('title').trim() + '"么?')) { $.ajax({ type: 'post', - url: '<%= user_resource_delete_user_path(User.current.id)%>' + '?resource_id=' + id + '&type=<%=@type %>&status=<%=@status %>' + url: '<%= user_resource_delete_user_path(User.current.id) %>' + '?resource_id=' + id + '&type=<%= @type %>&status=<%= @status %>' }); } diff --git a/app/views/users/_user_import_resource_list.html.erb b/app/views/users/_user_import_resource_list.html.erb index 26118f3f4..e886c16ca 100644 --- a/app/views/users/_user_import_resource_list.html.erb +++ b/app/views/users/_user_import_resource_list.html.erb @@ -6,22 +6,10 @@
      • <%= get_resource_type(attach.container_type)%>
      • diff --git a/app/views/users/_user_resource_info.html.erb b/app/views/users/_user_resource_info.html.erb index 9c321cdb5..c415ba0b4 100644 --- a/app/views/users/_user_resource_info.html.erb +++ b/app/views/users/_user_resource_info.html.erb @@ -19,13 +19,13 @@
        - + 全选 删除
      - - - +
      + 发送至 +
      选择 0 个资源
      @@ -215,7 +215,7 @@ document.oncontextmenu = function() {return true;} line.children().css("background-color",'white'); id = line.children().last().html(); - user_id = line.children().eq(6).html(); + user_id = line.children().eq(5).html(); if(user_id === '<%= User.current.id %>') { res_name = line.children().eq(1).children().attr('title'); res_link = line.children().eq(1).html(); diff --git a/app/views/users/_user_resource_tip_list.html.erb b/app/views/users/_user_resource_tip_list.html.erb index 67fe292ee..35ca130dd 100644 --- a/app/views/users/_user_resource_tip_list.html.erb +++ b/app/views/users/_user_resource_tip_list.html.erb @@ -1,7 +1,7 @@
      • 资源名称
      • -
      • 操作
      • +
      • <%= link_to "上传时间", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "created_on", :search => " "), :class => "fl", :remote => true %> <% if @order == "created_on" %> diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb index a8bd96859..d2e3242d8 100644 --- a/app/views/users/user_resource.html.erb +++ b/app/views/users/user_resource.html.erb @@ -55,9 +55,9 @@
      • 我的资源
      • -
      • - 申请资源 -
      • + + +
      •  
      • From b6de2dbd2d7376b4c36dbf8cc9070fbd140e5dd4 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 09:44:30 +0800 Subject: [PATCH 41/76] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 1 + app/views/users/_user_homework_attachment.html.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 203296160..1e12db25d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1096,6 +1096,7 @@ class UsersController < ApplicationController #引入资源列表根据关键词过滤 def user_ref_resource_search search = params[:search].to_s.strip.downcase + @user = User.current if(params[:type].blank? || params[:type] == "1") #全部 user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询 @attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index 9f9aea60f..669e7aa91 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -70,7 +70,7 @@
        上传附件 - <%= link_to "资源库",{:controller => 'users', :action => 'user_ref_resource_search', :id => User.current.id, :homework_id => container.id, :type => nil}, :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作品的附件", :remote => true %> + <%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作品的附件", :remote => true %> <% if defined?(has_program) && has_program %>
        编程 From 72ae31b7f989b21b80eae84131a7a237eecea94f Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 11:23:19 +0800 Subject: [PATCH 42/76] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=BB=A3=E7=A0=81=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 34 ++++++++++++++++------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1e12db25d..121b93dc5 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1095,23 +1095,27 @@ class UsersController < ApplicationController #引入资源列表根据关键词过滤 def user_ref_resource_search - search = params[:search].to_s.strip.downcase + if User.current.id.to_i != params[:id].to_i + render_403 + return + end + @resource_id = params[:mul_id] + @resource_type = params[:mul_type] + @order, @b_sort = params[:order] || "created_on", params[:sort] || "asc" + @score = @b_sort == "desc" ? "asc" : "desc" @user = User.current - if(params[:type].blank? || params[:type] == "1") #全部 - user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询 - @attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ - " or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))) and (filename like '%#{search}%') ").order("created_on desc") - elsif params[:type] == "2" #课程资源 + @switch_search = params[:search].nil? ? " " : params[:search] + search = "%#{@switch_search.strip.downcase}%" + # 别人的资源库是没有权限去看的 + if(params[:type] == "1") # 我的资源 + # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} - @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like '%#{search}%') ").order("created_on desc") - elsif params[:type] == "3" #项目资源 - @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like '%#{search}%')").order("created_on desc") - elsif params[:type] == "4" #附件 - @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc") - elsif params[:type] == "5" #用户资源 - @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like '%#{search}%')").order("created_on desc") - elsif params[:type] == "6" #公共资源 - @attachments = Attachment.where("(is_public =1 and is_publish = 1 and container_id is not null)" + "or (author_id = #{params[:id]} and is_publish = 0)").order("created_on desc") + user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id } + # user_org_ids = User.current.organizations.map {|o| o.id} + @attachments = get_my_resources_search(params[:id], user_course_ids, user_project_ids, @order, @score, search) + elsif (params[:type].blank? || params[:type] == "6") # 公共资源 + # 公共资源库:所有公开资源或者我上传的私有资源 + @attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search) end @type = params[:type] @limit = 7 From c4c0dd3c60b5577a5b147e5f81b5f0ed5a8d2b29 Mon Sep 17 00:00:00 2001 From: txz Date: Wed, 25 May 2016 13:50:59 +0800 Subject: [PATCH 43/76] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E7=AC=A6=E6=9C=AA=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1234567 | 2 +- public/assets/wechat/blog_detail.html | 2 +- public/assets/wechat/course_discussion.html | 2 +- public/assets/wechat/course_notice.html | 2 +- public/assets/wechat/homework_detail.html | 2 +- public/assets/wechat/issue_detail.html | 2 +- public/assets/wechat/jour_message_detail.html | 2 +- public/assets/wechat/project_discussion.html | 2 +- public/stylesheets/weui/weixin.css | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/1234567 b/1234567 index f2f064de8..ed94d1804 100644 --- a/1234567 +++ b/1234567 @@ -1 +1 @@ -{"access_token":"gRbIMUYYKFdANxpBGhYc8iauelCeSy3x7wODnZd1crF9upNiANKAdGaMKFLcgPz_0-oJvRtb7Ai0G1WnL_AnVV-tdRlzlCPpgpO9Z9k9EqrGz2iSLCAbQ35qk0f75KWlRRDfCEAVVH","expires_in":7200,"got_token_at":1464053170} \ No newline at end of file +{"access_token":"q51KZUeA6_-CCCH-Buy1m4pR7G9hh-9GT_Vn-h9oFq8qfF9SVVeagJZ7Jeuvv3k12UEXk7IxtAuXkrBlufaanGd81bNEEkXkPyhPveTHenmjj5fQa3GQmxCM9kUPhZjyXMPjCIAKZC","expires_in":7200,"got_token_at":1464146250} \ No newline at end of file diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index 8473b1446..8c5dcb73f 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -24,7 +24,7 @@
        -
        +
        
                                 
        {{journal.lasted_comment}}
        回复
        diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index c790fd5cf..bf450d447 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -30,7 +30,7 @@
        -
        +
        
                                 
        {{journal.lasted_comment}}
        回复
        diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index 18f62be1e..ac1f7dcea 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -30,7 +30,7 @@
        -
        +
        
                                 
        {{comments.created_on}}
        回复
        diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 5efa7c54d..41ff56f57 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -36,7 +36,7 @@
        -
        +
        
                                 
        {{journal.lasted_comment}}
        回复
        diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 20c35c664..08eb9a39d 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -34,7 +34,7 @@
        -
        +
        
                                 
        {{journal.created_on}}
        回复
        diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index f9aebd632..f813d19c1 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -22,7 +22,7 @@
        -
        +
        
                                 
        {{journal.lasted_comment}}
        回复
        diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 0c3f9aad3..c0a609bc0 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -30,7 +30,7 @@
        -
        +
        
                                     
        {{journal.lasted_comment}}
        回复
        diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 8b135dbeb..f0e336563 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -3,7 +3,7 @@ /*基本样式*/ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体";} -h1,h2,h3,h4,h5,p {padding:0px; margin:0px;} +h1,h2,h3,h4,h5,p,pre {padding:0px; margin:0px;} .f12 {font-size:12px;} .f13 {font-size:13px;} .f15 {font-size:15px;} From 457cf72263c9c91ef14670f882aa44a11cacd6aa Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 14:08:05 +0800 Subject: [PATCH 44/76] =?UTF-8?q?=E6=96=AD=E8=A1=8C=E6=A0=B7=E5=BC=8F=20?= =?UTF-8?q?=E5=8F=91=E9=80=81JS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_resources_list.html.erb | 19 ++++++++++++++++--- app/views/users/user_resource.html.erb | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index 26e8f922b..cdd270a56 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -99,13 +99,26 @@ if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。 $.ajax({ type: 'get', - url: '<%= search_user_project_user_path(User.current.id)%>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type%>", + url: '<%= search_user_project_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>", data:{send_type:'file'} }); - }else{ + }else if (lastSendType === '1'){ + $.ajax({ + type: 'get', + url: '<%= search_user_course_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>", + data:{send_type:'file'} + }); + }else if (lastSendType === '3'){ + $.ajax({ + type: 'get', + url: '<%= search_user_org_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>", + data:{send_type:'file'} + }); + } + else{ $.ajax({ type: 'get', - url: '<%= search_user_course_user_path(User.current.id)%>' + '?'+ $("#resources_list_form").serialize() + "&type=<%= @type%>", + url: '<%= search_user_course_user_path(User.current.id)%>' + '?'+ $("#resources_list_form").serialize() + "&type=<%= @type %>", data:{send_type:'file'} }); diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb index d2e3242d8..3c70e6c33 100644 --- a/app/views/users/user_resource.html.erb +++ b/app/views/users/user_resource.html.erb @@ -58,7 +58,7 @@ -
      •  
      • +
      •  
      • <%= render :partial => 'user_resource_type_filter' %> From 921b01e8e3eda778aa56676b000262bf9a40e5b7 Mon Sep 17 00:00:00 2001 From: txz Date: Wed, 25 May 2016 14:26:49 +0800 Subject: [PATCH 45/76] =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=96=87=E5=AD=97=E5=86=85=E5=AE=B9=E6=BB=91=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 7 ++++++- public/stylesheets/weui/weixin.css | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 5d94afca4..0817eaa58 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -136,7 +136,7 @@ app.factory('common', function($http, auth, $routeParams){ url: apiUrl+ "new_comment/"+id, data: userInfo }).then(function successCallback(response) { - alert("提交成功"); + //alert("提交成功"); //数据提交完成,回复按钮启用 data.disabled = false; if(typeof cb === 'function'){ @@ -410,11 +410,16 @@ app.directive('inputAuto',function(){ scope: {}, link: function(scope, element){ var copyContainer = element.parent().children().eq(0); + var sendButton = element.parent().next(); element.on('input',function(){ + console.log(sendButton); copyContainer.html(element[0].value); var textHeight = copyContainer[0].scrollHeight; element.css('height', textHeight + 'px'); }); + sendButton.on('click',function(){ + element.css('height','28px'); + }); } } }); diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index f0e336563..0455c81e3 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -70,7 +70,7 @@ a.underline {text-decoration:underline;} .post-reply-date, .post-reply-trigger {font-size:13px;} .post-input-container {padding-right:2px;} .copy-input {width:100%; height:28px; line-height:28px; border-radius:3px; position:absolute; left:-9999em;} -.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:hidden; resize:none;} +.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:auto; resize:none;} .post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;} .reply-icon {background:url(/images/wechat/wechat_icon.gif) -100px 1px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} .praise-icon {background:url(/images/wechat/wechat_icon.gif) -100px -38px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} From d9bd13c2fc5c9a1b5928a6db27b2ddf5c1078e03 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 25 May 2016 14:57:46 +0800 Subject: [PATCH 46/76] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_copy_course.html.erb | 32 +++++------ app/views/courses/new.html.erb | 30 +++++----- app/views/courses/settings.html.erb | 22 ++++---- public/javascripts/course.js | 74 ++++++++++++------------- 4 files changed, 79 insertions(+), 79 deletions(-) diff --git a/app/views/courses/_copy_course.html.erb b/app/views/courses/_copy_course.html.erb index 402e00cf6..3b6d55d96 100644 --- a/app/views/courses/_copy_course.html.erb +++ b/app/views/courses/_copy_course.html.erb @@ -1,17 +1,17 @@ \ No newline at end of file diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index b0c4a067f..82123a767 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -33,35 +33,35 @@ - - + +
      • - - + +
      • - <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"time"} %> - <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"term"} %> + <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"edit_time"} %> + <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"edit_term"} %>
      • - <%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {:id=>"end_time"} %> - <%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"end_term"} %> - + <%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {:id=>"edit_end_time"} %> + <%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"edit_end_term"} %> +
      • - + 显示明码 - +
        学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。
      • diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 0bba3264b..7cfad6005 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -73,79 +73,79 @@ function hidden_homework_score_form() /////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////新建课程相关 //验证课程名称 -function regex_course_name() +function regex_course_name(str) { - var name = $.trim($("#course_name").val()); + var name = $.trim($("#"+str+"_course_name").val()); if(name.length < 2) { - $("#course_name_notice").show(); + $("#"+str+"_course_name_notice").show(); return false; } else { - $("#course_name_notice").hide(); + $("#"+str+"_course_name_notice").hide(); return true; } } //验证课程学时 -function regex_course_class_period() +function regex_course_class_period(str) { - var class_period = $.trim($("#class_period").val()); + var class_period = $.trim($("#"+str+"_class_period").val()); var regex = /^\d*$/; if(class_period.length == 0) { - $("#course_class_period_notice").html("学时总数不能为空"); - $("#course_class_period_notice").show(); + $("#"+str+"_course_class_period_notice").html("学时总数不能为空"); + $("#"+str+"_course_class_period_notice").show(); return false; } else if (regex.test(class_period)) { if(parseInt(class_period) > 0) { - $("#course_class_period_notice").html(""); - $("#course_class_period_notice").hide(); + $("#"+str+"_course_class_period_notice").html(""); + $("#"+str+"_course_class_period_notice").hide(); return true; } else { - $("#course_class_period_notice").html("学时总数必须大于0"); - $("#course_class_period_notice").show(); + $("#"+str+"_course_class_period_notice").html("学时总数必须大于0"); + $("#"+str+"_course_class_period_notice").show(); return false; } } else { - $("#course_class_period_notice").html("学时总数必须为正整数"); - $("#course_class_period_notice").show(); + $("#"+str+"_course_class_period_notice").html("学时总数必须为正整数"); + $("#"+str+"_course_class_period_notice").show(); return false; } } //验证开始学期和结束学期 -function regex_time_term(){ - var obj_time = document.getElementById("time"); - var obj_end_time = document.getElementById("end_time"); - var obj_term = document.getElementById("term"); - var obj_end_term = document.getElementById("end_term"); +function regex_time_term(str){ + var obj_time = document.getElementById(str+"_time"); + var obj_end_time = document.getElementById(str+"_end_time"); + var obj_term = document.getElementById(str+"_term"); + var obj_end_term = document.getElementById(str+"_end_term"); var time = obj_time.options[obj_time.selectedIndex]; var end_time = obj_end_time.options[obj_end_time.selectedIndex]; var term = obj_term.options[obj_term.selectedIndex]; var end_term = obj_end_term.options[obj_end_term.selectedIndex]; if(time.value == end_time.value) { if(set_term_val(term.value) > set_term_val(end_term.value)) { - $("#course_time_term_notice").html("开始学期不能晚于结束学期"); - $("#course_time_term_notice").show(); + $("#"+str+"_course_time_term_notice").html("开始学期不能晚于结束学期"); + $("#"+str+"_course_time_term_notice").show(); return false; } else { - $("#course_time_term_notice").html(""); - $("#course_time_term_notice").hide(); + $("#"+str+"_course_time_term_notice").html(""); + $("#"+str+"_course_time_term_notice").hide(); return true; } } else if(time.value < end_time.value) { - $("#course_time_term_notice").html(""); - $("#course_time_term_notice").hide(); + $("#"+str+"_course_time_term_notice").html(""); + $("#"+str+"_course_time_term_notice").hide(); return true; } else { - $("#course_time_term_notice").html("开始学期不能晚于结束学期"); - $("#course_time_term_notice").show(); + $("#"+str+"_course_time_term_notice").html("开始学期不能晚于结束学期"); + $("#"+str+"_course_time_term_notice").show(); return false; } } @@ -160,32 +160,32 @@ function set_term_val(val) { } } //验证密码 -function regex_course_password() +function regex_course_password(str) { - var class_period = $.trim($("#course_course_password").val()); + var class_period = $.trim($("#"+str+"_course_course_password").val()); var regex = /^\w+$/; if(class_period.length == 0) { - $("#course_course_password_notice").html("课程密码不能为空"); - $("#course_course_password_notice").show(); + $("#"+str+"_course_course_password_notice").html("课程密码不能为空"); + $("#"+str+"_course_course_password_notice").show(); return false; } else if (regex.test(class_period)) { - $("#course_course_password_notice").html(""); - $("#course_course_password_notice").hide(); + $("#"+str+"_course_course_password_notice").html(""); + $("#"+str+"_course_course_password_notice").hide(); return true; } else { - $("#course_course_password_notice").html("课程密码有非法字符"); - $("#course_course_password_notice").show(); + $("#"+str+"_course_course_password_notice").html("课程密码有非法字符"); + $("#"+str+"_course_course_password_notice").show(); return false; } } //提交新建课程 function submit_new_course() { - if(regex_course_name()&®ex_course_class_period()&®ex_time_term()&®ex_course_password()) + if(regex_course_name('new')&®ex_course_class_period('new')&®ex_time_term('new')&®ex_course_password('new')) { $("#new_course").submit(); } @@ -193,7 +193,7 @@ function submit_new_course() function submit_edit_course(id) { - if(regex_course_name()&®ex_course_class_period()&®ex_time_term()&®ex_course_password()) + if(regex_course_name('edit')&®ex_course_class_period('edit')&®ex_time_term('edit')&®ex_course_password('edit')) { $("#edit_course_"+id).submit(); } From c8467a50a023a2381dede7b6fdf359a3bf4f03ad Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 25 May 2016 16:19:41 +0800 Subject: [PATCH 47/76] =?UTF-8?q?=E8=87=AA=E5=B7=B1=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=BB=99=E8=87=AA=E5=B7=B1=E7=82=B9=E8=B5=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/praise_tread_controller.rb | 16 ++++++++-------- app/views/blog_comments/show.html.erb | 12 ++---------- app/views/messages/_course_show.html.erb | 10 +--------- app/views/messages/_project_show.html.erb | 12 ++---------- app/views/news/_course_show.html.erb | 12 ++---------- app/views/org_document_comments/show.html.erb | 12 ++---------- .../organizations/_org_course_homework.html.erb | 14 +++----------- .../organizations/_org_course_message.html.erb | 12 ++---------- .../organizations/_org_course_news.html.erb | 14 +++----------- .../organizations/_org_project_issue.html.erb | 12 ++---------- .../organizations/_org_subfield_message.html.erb | 12 ++---------- .../organizations/_org_subfield_news.html.erb | 12 ++---------- .../organizations/_project_message.html.erb | 12 ++---------- .../organizations/_show_org_document.html.erb | 12 ++---------- app/views/projects/_project_news.html.erb | 12 ++---------- app/views/users/_course_homework.html.erb | 12 ++---------- .../users/_course_journalsformessage.html.erb | 13 +++++++++---- app/views/users/_course_message.html.erb | 12 ++---------- app/views/users/_course_news.html.erb | 12 ++---------- app/views/users/_project_issue_reply.html.erb | 14 +++----------- app/views/users/_project_message.html.erb | 12 ++---------- app/views/users/_user_activities.html.erb | 12 ++++++------ app/views/users/_user_blog.html.erb | 12 ++---------- app/views/users/_user_homework_detail.html.erb | 12 ++---------- .../users/_user_journalsformessage.html.erb | 12 ++---------- 25 files changed, 69 insertions(+), 240 deletions(-) diff --git a/app/controllers/praise_tread_controller.rb b/app/controllers/praise_tread_controller.rb index 96eeab884..0c665341a 100644 --- a/app/controllers/praise_tread_controller.rb +++ b/app/controllers/praise_tread_controller.rb @@ -25,14 +25,14 @@ class PraiseTreadController < ApplicationController return end @horizontal = params[:horizontal].downcase == "false" ? false:true if params[:horizontal] - if @obj.respond_to?("author_id") - author_id = @obj.author_id - elsif @obj.respond_to?("user_id") - author_id = @obj.user_id - end - unless author_id == User.current.id - praise_tread_plus(@obj_type,@obj_id,1) - end + # if @obj.respond_to?("author_id") + # author_id = @obj.author_id + # elsif @obj.respond_to?("user_id") + # author_id = @obj.user_id + # end + # unless author_id == User.current.id + praise_tread_plus(@obj_type,@obj_id,1) + # end respond_to do |format| format.js end diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index d3763abf3..288a02d56 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -122,11 +122,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if @article.author == User.current %> - - <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%> - <% end %>
        @@ -162,12 +158,8 @@
        <%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> + @@ -131,11 +127,7 @@ <%= format_time(reply.created_on) %> @@ -187,11 +183,7 @@ <%= format_time(reply.created_on) %> @@ -137,11 +133,7 @@ <%= format_time(reply.created_on) %> @@ -100,11 +96,7 @@
        <%= format_time(reply.created_at) %> - <% if reply.creator_id.to_i == User.current.id.to_i %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
        <%if count>3 %> @@ -359,11 +355,7 @@
        - <% if comment.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%= link_to( diff --git a/app/views/organizations/_org_course_message.html.erb b/app/views/organizations/_org_course_message.html.erb index e68745f7a..03e986716 100644 --- a/app/views/organizations/_org_course_message.html.erb +++ b/app/views/organizations/_org_course_message.html.erb @@ -74,11 +74,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%#=format_date(activity.updated_on)%>
        @@ -117,11 +113,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
        diff --git a/app/views/organizations/_org_course_news.html.erb b/app/views/organizations/_org_course_news.html.erb index acf0f0377..8c260c21c 100644 --- a/app/views/organizations/_org_course_news.html.erb +++ b/app/views/organizations/_org_course_news.html.erb @@ -44,12 +44,8 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> +
        <%#= format_date(activity.updated_on) %>
        <%if count>3 %> @@ -86,11 +82,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
        diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index 9ca10c91d..94eb2820a 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -55,11 +55,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%#= format_date(activity.updated_on) %>
        @@ -97,11 +93,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
        diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index 61bc5bc7f..bcc43610e 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -84,11 +84,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%if count>3 %> @@ -122,11 +118,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
        diff --git a/app/views/organizations/_org_subfield_news.html.erb b/app/views/organizations/_org_subfield_news.html.erb index 5d6c38542..662a965e9 100644 --- a/app/views/organizations/_org_subfield_news.html.erb +++ b/app/views/organizations/_org_subfield_news.html.erb @@ -64,11 +64,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%#= format_date(activity.updated_on) %>
        @@ -106,11 +102,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
        diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index e1b000c70..4407d86bd 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -57,11 +57,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%#=format_date(activity.updated_on)%>
        @@ -96,11 +92,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
        diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index e8f531206..3042ca9ae 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -69,11 +69,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if document.creator_id.to_i == User.current.id.to_i %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
        <% if count > 3 %> @@ -102,11 +98,7 @@ <%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %> <%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %> - <% if comment.creator_id.to_i == User.current.id.to_i %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
        <% unless comment.content.blank? %> diff --git a/app/views/projects/_project_news.html.erb b/app/views/projects/_project_news.html.erb index 6d97b252d..7baf93e4f 100644 --- a/app/views/projects/_project_news.html.erb +++ b/app/views/projects/_project_news.html.erb @@ -44,11 +44,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%#= format_date(activity.updated_on) %>
        @@ -86,11 +82,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
        diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 3721244ed..e694f471e 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -296,11 +296,7 @@ ︿ <%= count>0 ? "(#{count})" : "" %> - <% if activity.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        @@ -365,11 +361,7 @@
        - <% if comment.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%= link_to( diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb index aeb7f5e5d..a76081859 100644 --- a/app/views/users/_course_journalsformessage.html.erb +++ b/app/views/users/_course_journalsformessage.html.erb @@ -33,10 +33,12 @@
        <% count = fetch_user_leaveWord_reply(activity).count %>
        -
        -
        -
        - 回复(<%= count %>) +
        +
        回复 + <%= count>0 ? "(#{count})" : "" %> + + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> +
        <%if count>3 %> @@ -72,6 +74,9 @@ <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(comment.created_on) %> + + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> +
        <%= comment.notes.html_safe %> diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 8b6056309..c0e667396 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -91,11 +91,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%#=format_date(activity.updated_on)%>
        @@ -134,11 +130,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
        diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 19d62b14e..b89873b43 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -69,11 +69,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%#= format_date(activity.updated_on) %>
        @@ -111,11 +107,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
        diff --git a/app/views/users/_project_issue_reply.html.erb b/app/views/users/_project_issue_reply.html.erb index 5323b76b6..2b43d8acf 100644 --- a/app/views/users/_project_issue_reply.html.erb +++ b/app/views/users/_project_issue_reply.html.erb @@ -4,11 +4,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%#= format_date(activity.updated_on) %>
        @@ -46,12 +42,8 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> +
        <% if reply.details.any? %> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index b6e3f9a94..b3c2fea59 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -90,11 +90,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%#=format_date(activity.updated_on)%>
        @@ -129,11 +125,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
        diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 2fe7315d5..432074191 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -5,24 +5,24 @@ $(document).ready(function(){ $("#relateProject,.relatePInfo").mouseover(function(){ $(".relatePInfo").css("display","block"); - }) + }); $("#relateProject,.relatePInfo").mouseout(function(){ $(".relatePInfo").css("display","none"); - }) + }); $(".coursesLineGrey").mouseover(function(){ $(this).css("color","#ffffff"); - }) + }); $(".coursesLineGrey").mouseout(function(){ $(this).css("color","#808080"); - }) + }); $(".homepagePostSetting,.coursesLineGrey").mouseover(function(){ $(this).prev().css("color","#ffffff"); $(this).css("z-index", "9999"); - }) + }); $(".homepagePostSetting").mouseout(function(){ $(this).prev().css("color","#808080"); $(this).css("z-index", "1"); - }) + }); }) diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index de5ffc31f..522bdc835 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -50,11 +50,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        <%#= format_date(activity.updated_on) %>
        @@ -92,11 +88,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
        diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index f81fbabf5..650ced5dc 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -306,11 +306,7 @@ ︿ <%= count>0 ? "(#{count})" : "" %> - <% if homework_common.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>homework_common, :user_activity_id=>homework_common.id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>homework_common, :user_activity_id=>homework_common.id,:type=>"activity"}%>
        @@ -379,11 +375,7 @@
        - <% if comment.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%= link_to( diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index 47d5145ac..6967bb398 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -64,11 +64,7 @@
        回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
        @@ -106,11 +102,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>