From d329b60a8a7e5d70a20e57096029c011deec0757 Mon Sep 17 00:00:00 2001 From: txz Date: Fri, 20 May 2016 20:26:04 +0800 Subject: [PATCH 01/76] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E4=B8=AD=E5=8E=BB=E7=99=BD=E5=BA=95=EF=BC=8C=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=9B=BA=E5=AE=9A=E8=A1=8C=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/images/wechat/wechat_icon.png | Bin 4259 -> 5631 bytes public/images/wechat/wechat_icon2.png | Bin 0 -> 4259 bytes public/stylesheets/weui/weixin.css | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100755 public/images/wechat/wechat_icon2.png diff --git a/public/images/wechat/wechat_icon.png b/public/images/wechat/wechat_icon.png index cbc3eb565cc9ddd9ce1a9618becd0035d38f0919..7aa0a4351c720ed5b5f10f056d2d1d14be1d05f6 100755 GIT binary patch literal 5631 zcmbVP)mPMk*8Nd3q)2yzARvt}(jbhKFmy9?cMXk%NH>xqDM(3om!yCoT?33r3`qCK z_aEGQAI{znXRY&a)?WMU^HE(*kpPz(7XSc)w-9;gBZofL2hfv8AMBf7d z@JRl@(15HQN&vuBwUd)mSGRTXbn&otab`$_Hd?`VCKX|vbyyDW@?lgJupi#aDFn}q~| z#88>Q2LS4;sh)dLsYK+?*2a!C(h+q!P;l>X@EzubAvg1S3%>EqnNV%&KF3Q`=N;7yLis2O`-2b++@+m zdLNtBnN^42Ezl%+rXOjW#Jj-)#|-IrI4M2^Kt<%cZnZ}2hEd1vphGnD7(%^iZ$LWe zgeR67F9{&B5fXr306#41ANrz31{=SJw4$3Z zr-!b+n*ts7L|z)7wOgD>_Q_TVE$$b}bQvnGZty&2Lk$LX{+X{8IQ>fg9s&u6fy2bk!mmx47(Shm&w{E z8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=AD=90=E8=AE=BE=E4=B8=BA=E9=A6=96=E9=A1=B5=E5=90=8E?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=9C=A8=E6=A0=8F=E7=9B=AE=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_activities.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index c00cc6161..2c135cd2e 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -46,7 +46,7 @@ <% end %> - <% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %> + <% if act.org_act_type == 'OrgDocumentComment' %> <%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %> <% end %> <% end %> From e512154ea97232fe5a6aeb7f083beacc99be7dfc Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 20 May 2016 21:00:36 +0800 Subject: [PATCH 03/76] =?UTF-8?q?=E5=8F=A4=E5=89=91=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_resources_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index 9dc530c72..dcebddb8b 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -72,7 +72,7 @@ function batch_delete(){ var data = $("#resources_list_form").serialize(); if($("input[type=checkbox][data-deleteble=N]:checked").length != 0){ - alert("您只能删除自己上传的资源,请重新选择后再删除。"); + alert("您无法删除此资源!"); return; } if($("input[type=checkbox][data-has-history=Y]:checked").length != 0){ From 0fcd8ae86d677240c6728fa522ae37ee11f128e0 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 20 May 2016 21:10:53 +0800 Subject: [PATCH 04/76] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E9=BC=A0=E6=A0=87=E7=82=B9=E5=87=BB=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_import_resource_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_import_resource_list.html.erb b/app/views/users/_user_import_resource_list.html.erb index efae73a3d..dd96eb10e 100644 --- a/app/views/users/_user_import_resource_list.html.erb +++ b/app/views/users/_user_import_resource_list.html.erb @@ -14,7 +14,7 @@ <% if attach.is_public == 0 && !attach_show_allow(attach) && attach.get_apply_resource_status(attach.id, attach.author_id) != 2 %> - <%= attach.filename %> + <%= attach.filename %> <% else %> <%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename%> <% end %> From 039d11e862f4c5f82a9d5f62f9497adc15cf5f4f Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 20 May 2016 21:48:51 +0800 Subject: [PATCH 05/76] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_resources_list.html.erb | 2 +- app/views/users/user_resource.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index dcebddb8b..1349ba2b7 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -48,7 +48,7 @@
  • <%= get_resource_type(attach.container_type)%>
  • <%= attach.is_public %>
  • -
  • <%= attach.get_apply_resource_status(attach.id, attach.author_id) %>
  • +
  • <%= attach.get_apply_resource_status(attach.id, User.current.id) %>
  • <%= attach_show_allow(attach) == true ? 0 : 1 %>
  • <%= attach.id %>
  • diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb index 0bd5724c1..f773e3c48 100644 --- a/app/views/users/user_resource.html.erb +++ b/app/views/users/user_resource.html.erb @@ -56,7 +56,7 @@ 我的资源
  • - 私有资源 + 引用资源
  •  
  • From 76006ef3e71b1c66ec2c124b9d02ef032931acbd Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 20 May 2016 22:07:33 +0800 Subject: [PATCH 06/76] =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=80=E7=BA=A7?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=B8=96=E5=AD=90=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org_document_comments_controller.rb | 17 ++++++++--------- .../sub_document_comments_controller.rb | 2 ++ app/views/org_document_comments/destroy.js.erb | 2 +- app/views/sub_document_comments/destroy.js.erb | 2 +- app/views/sub_document_comments/show.html.erb | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index 02e74237a..82062d3dd 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -102,15 +102,14 @@ class OrgDocumentCommentsController < ApplicationController end def destroy - @org_document_comment = SubDocumentComment.find(params[:id]) - @sub_domain = @org_document_comment.sub_domain - @org_subfield = @sub_domain.org_subfield - # org = @org_document_comment.organization - # if @org_document_comment.id == org.home_id - # org.update_attributes(:home_id => nil) - # end - @org_document_comment.destroy - # end + @org_document_comment = OrgDocumentComment.find(params[:id]) + @org_sub_id = @org_document_comment.org_subfield_id + org = @org_document_comment.organization + if @org_document_comment.id == org.home_id + org.update_attributes(:home_id => nil) + end + if @org_document_comment.destroy + end respond_to do |format| format.js end diff --git a/app/controllers/sub_document_comments_controller.rb b/app/controllers/sub_document_comments_controller.rb index 767e1ba29..cdf153a20 100644 --- a/app/controllers/sub_document_comments_controller.rb +++ b/app/controllers/sub_document_comments_controller.rb @@ -125,6 +125,8 @@ class SubDocumentCommentsController < ApplicationController def destroy @sub_document_comment = SubDocumentComment.find(params[:id]) @sub_document_comment.destroy + @sub_domain = @sub_document_comment.sub_domain + @org_subfield = @sub_domain.org_subfield rescue ActiveRecord::RecordNotFound respond_to do |format| # format.html{ diff --git a/app/views/org_document_comments/destroy.js.erb b/app/views/org_document_comments/destroy.js.erb index 1e830d7bc..394078db1 100644 --- a/app/views/org_document_comments/destroy.js.erb +++ b/app/views/org_document_comments/destroy.js.erb @@ -1,6 +1,6 @@ //location.reload(); <% if params[:detail_page] %> - window.location.href = '<%= org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @sub_domain.id)%>'; + window.location.href = '<%= organization_path(params[:organization_id],:org_subfield_id => @org_sub_id )%>'; <% else %> window.location.reload(); <% end %> \ No newline at end of file diff --git a/app/views/sub_document_comments/destroy.js.erb b/app/views/sub_document_comments/destroy.js.erb index 4a45e48dd..d4c7bffcd 100644 --- a/app/views/sub_document_comments/destroy.js.erb +++ b/app/views/sub_document_comments/destroy.js.erb @@ -1,6 +1,6 @@ //location.reload(); <% if params[:detail_page] %> -window.location.href = '<%= org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @subdomain.id)%>'; +window.location.href = '<%= org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @sub_domain.id)%>'; <% else %> window.location.reload(); <% end %> \ No newline at end of file diff --git a/app/views/sub_document_comments/show.html.erb b/app/views/sub_document_comments/show.html.erb index fc35d00cb..7050c1c66 100644 --- a/app/views/sub_document_comments/show.html.erb +++ b/app/views/sub_document_comments/show.html.erb @@ -56,7 +56,7 @@ <%= link_to "编辑文章", edit_org_subfield_sub_domain_sub_document_comment_path(@document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => @document.sub_domain.id, :flag => 1), :class => "postOptionLink" %>
  • - <%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @organization.id, :detail_page => 1), :method => 'delete', + <%= link_to "删除文章", org_subfield_sub_domain_sub_document_comment_path(@document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => @document.sub_domain.id, :flag => 0, :detail_page=>1), :method => 'delete', :data => {:confirm => l(:text_are_you_sure)}, :remote => true, :class => 'postOptionLink' %>
  • From eead7962cf6483bfcee347062611343780d1b251 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 21 May 2016 11:39:50 +0800 Subject: [PATCH 07/76] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 6 ++++- app/controllers/users_controller.rb | 2 +- app/helpers/application_helper.rb | 19 +++++++++++---- app/models/attachment.rb | 3 ++- app/views/users/_resources_list.html.erb | 23 +++++++++++-------- .../users/_user_import_resource_list.html.erb | 6 ++--- app/views/users/user_resource.html.erb | 2 +- 7 files changed, 39 insertions(+), 22 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d6470ce51..cbce67618 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -363,7 +363,11 @@ class ApplicationController < ActionController::Base when "contest" return true when "Course" - allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false) + if @attachment.get_status_by_attach(User.current.id) == 2 + return true + else + allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false) + end else return true end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 52fdad2e7..2c4355180 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2705,7 +2705,7 @@ class UsersController < ApplicationController # 获取公共资源搜索 def get_public_resources_search user_course_ids, user_project_ids, order, score, search - attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") + attachments = Attachment.where("is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}") end # 获取我的资源 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8d9c9733e..4d92808d4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -58,12 +58,21 @@ module ApplicationHelper when "Course" User.current.member_of_course?(attachment.container) ? true : false when "OrgSubfield" - User.current.member_of_org?(attachment.container) ? true : false + User.current.member_of_org?(attachment.container.organization) ? true : false when "Principal" User.current.id == attachment.author_id ? true : false end end + # 判断某个私有资源是否可以发送下载权限 + # 结果为true不能下载,false可以下载 + def private_attachment_allow attachment_id + attach = Attachment.find(attachment_id) + # 条件取否,result结果为true则不能下载 + result = attach.is_public == 0 && attach.author != User.current && !attach.get_apply_resource_status(attach.id, User.current.id) && !attach_show_allow(attach) + return result + end + # Time 2015-03-24 15:27:29 # Author lizanle # Description 从硬盘上删除对应的资源文件 @@ -2109,20 +2118,20 @@ module ApplicationHelper candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1) elsif attachment.container.is_a?(Project) project = attachment.container - candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1) + candown = User.current.member_of?(project) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2 elsif (attachment.container.has_attribute?(:board) || attachment.container.has_attribute?(:board_id)) && attachment.container.board && attachment.container.board.project project = attachment.container.board.project candown = User.current.member_of?(project) || (project.is_public && attachment.is_public == 1) elsif (attachment.container.has_attribute?(:course) ||attachment.container.has_attribute?(:course_id) ) && attachment.container.course course = attachment.container.course - candown = User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) + candown = User.current.member_of_course?(course) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2 elsif attachment.container.is_a?(Course) course = attachment.container - candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) + candown= User.current.member_of_course?(course) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2 elsif attachment.container.is_a?(OrgSubfield) org = attachment.container.organization - candown = User.current.member_of_org?(org) || (org.is_public && attachment.is_public == 1) + candown = User.current.member_of_org?(org) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2 elsif attachment.container.is_a?(OrgDocumentComment) org = attachment.container.organization candown = User.current.member_of_org?(org) || (org.is_public && attachment.is_public == 1) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index b7ec264fd..8f9ee2d85 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -142,7 +142,8 @@ class Attachment < ActiveRecord::Base end def get_apply_resource_status attachment_id, author_id - ApplyResource.where("attachment_id =? and apply_user_id =?", attachment_id, author_id).first.try(:status) + status = ApplyResource.where("attachment_id =? and user_id =?", attachment_id, author_id).first.try(:status) + status == 2 ? true :false end # add by nwb diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index 1349ba2b7..3aaed7594 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -6,7 +6,7 @@ <% attachments.each do |attach| %>
    • - <% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && attach.get_apply_resource_status(attach.id, attach.author_id) != 2 && !attach_show_allow(attach) %> + <% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> <% else %> @@ -14,17 +14,17 @@
    • - <% if attach.is_public == 0 && !attach_show_allow(attach) && attach.get_apply_resource_status(attach.id, attach.author_id) != "2" %> + <% 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 attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current %> + <% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %> 私有 <% end %>
    • - <% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && !attach_show_allow(attach) %> + <% 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) %> @@ -36,7 +36,12 @@ 已拒绝 <% end %> <% else %> - -- + <% ah = attach.get_status_by_attach(User.current.id) %> + <% if ah == 2 %> + 可引用 + <% else %> + -- + <% end %> <% end %>
    • <%= format_date(attach.created_on) %>
    • @@ -47,9 +52,9 @@
    • <%= get_resource_type(attach.container_type)%>
    • -
    • <%= attach.is_public %>
    • +
    • <%= private_attachment_allow(attach.id) %>
    • <%= attach.get_apply_resource_status(attach.id, User.current.id) %>
    • -
    • <%= attach_show_allow(attach) == true ? 0 : 1 %>
    • +
    • <%= private_attachment_allow(attach.id) ? 0 : 1 %>
    • <%= attach.id %>
    @@ -99,11 +104,9 @@ document.oncontextmenu = function() {return true;} line.children().css("background-color",'white'); id = line.children().last().html(); - is_public = line.children().eq(11).html(); user_id = line.children().eq(6).html(); - apply_status = line.children().eq(12).html(); allow = line.children().eq(13).html(); - if(is_public == 0 && user_id != '<%= User.current.id %>' && apply_status != 2 && allow == 1){ + if( allow == 0){ alert('您无权发送私有资源') }else{ if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。 diff --git a/app/views/users/_user_import_resource_list.html.erb b/app/views/users/_user_import_resource_list.html.erb index dd96eb10e..e8ed684c6 100644 --- a/app/views/users/_user_import_resource_list.html.erb +++ b/app/views/users/_user_import_resource_list.html.erb @@ -6,20 +6,20 @@
    • - 引用资源 + 申请资源
    •  
    • From 103af96ac2876e4bdce63fcbd15553ee669c4dc1 Mon Sep 17 00:00:00 2001 From: txz Date: Mon, 23 May 2016 10:26:17 +0800 Subject: [PATCH 08/76] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E4=B8=ADgif=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 447365c35..7737a46dc 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -406,7 +406,7 @@ app.directive('loadingSpinner', function ($http) { return { restrict: 'A', replace: true, - template: '
      加载中...
      ', + template: '
      加载中...
      ', link: function (scope, element, attrs) { scope.$watch('activeCalls', function (newVal, oldVal) { From a60356091bf5291a0d36bc31b508552639ed9ea3 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 23 May 2016 11:02:21 +0800 Subject: [PATCH 09/76] =?UTF-8?q?issue=E4=B8=AD=E6=B7=BB=E5=8A=A0=E7=B1=BB?= =?UTF-8?q?=E5=9E=8Btag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_detail.html.erb | 10 +++++----- app/views/users/_project_issue.html.erb | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb index 03c420c99..ec9a0bc54 100644 --- a/app/views/issues/_detail.html.erb +++ b/app/views/issues/_detail.html.erb @@ -6,15 +6,15 @@

      <% case @issue.tracker_id %> <% when 1%> - + 【缺陷】 <% when 2%> - + 【功能】 <% when 3%> - + 【支持】 <% when 4%> - + 【任务】 <% when 5%> - + 【周报】 <% end %> <%= @issue.subject %> <%= get_issue_priority(@issue.priority_id)[1] %>

      diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 4b13850de..d8714400d 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -38,16 +38,16 @@
      <% case activity.tracker_id %> - <% when 1%> - + <% when 1%> + 【缺陷】 <% when 2%> - + 【功能】 <% when 3%> - + 【支持】 <% when 4%> - + 【任务】 <% when 5%> - + 【周报】 <% end %> <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5" %> @@ -100,4 +100,4 @@ $(function(){ user_card_show_hide(); }); - + From d70f42b4137d51b8c46d0d71052bb3e134868a76 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 23 May 2016 15:03:22 +0800 Subject: [PATCH 10/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 5eff3db9e877e874589d6c936089937cb2950c85 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Mon, 23 May 2016 15:58:32 +0800 Subject: [PATCH 11/76] =?UTF-8?q?1.=E9=97=AE=E7=AD=94=E5=8C=BA=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=8E=92=E5=BA=8FBUG=E4=BF=AE=E5=A4=8D=E3=80=81?= =?UTF-8?q?=E5=8F=AA=E6=98=BE=E7=A4=BA=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E3=80=81=E5=8F=91=E8=B4=B4=E4=BA=BA=E6=94=BE=E5=B7=A6=E4=B8=8B?= =?UTF-8?q?=E8=A7=92=E3=80=81=E5=86=85=E5=AE=B9=E6=88=AA=E6=96=AD=E4=B8=80?= =?UTF-8?q?=E7=82=B9=202.KE=E7=BC=96=E8=BE=91=E5=99=A8=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=97=B6=E9=9C=80=E6=9C=89=E4=B8=80=E7=82=B9?= =?UTF-8?q?=E4=B8=8B=E8=BE=B9=E8=B7=9D=203.KE=E4=B8=AD=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=AE=B5=E8=90=BD=E6=98=BE=E7=A4=BA=E6=97=B6?= =?UTF-8?q?=E6=9C=89=E9=A2=9C=E8=89=B2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_org_subfield_leftMD.html.erb | 20 +++++++++---------- app/views/users/_course_boardlist.html.erb | 11 +++++----- app/views/users/_course_newslist.html.erb | 9 ++++----- app/views/users/_intro_content_ex.html.erb | 5 +++++ app/views/users/_project_boardlist.html.erb | 11 +++++----- app/views/users/_user_course_list.html.erb | 2 +- public/javascripts/create_kindeditor.js | 2 +- public/stylesheets/public.css | 8 ++++---- public/stylesheets/public_new.css | 6 +++--- 9 files changed, 38 insertions(+), 36 deletions(-) diff --git a/app/views/organizations/_org_subfield_leftMD.html.erb b/app/views/organizations/_org_subfield_leftMD.html.erb index d0439439a..afa7d0716 100644 --- a/app/views/organizations/_org_subfield_leftMD.html.erb +++ b/app/views/organizations/_org_subfield_leftMD.html.erb @@ -28,7 +28,7 @@ <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
      - <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %> + <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %> <%#= link_to activity.description.to_s.html_safe, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
      <%#= link_to "更多", student_work_index_url_in_org(activity.id), :class => "more-btn", :target => "_blank" %> @@ -50,7 +50,7 @@ <% end %>
      - <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.content, :maxheight=>54, :maxwordsnum => 28} %> + <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.content, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %> <%#= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
      @@ -67,7 +67,7 @@ <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
      - <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %> + <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %> <%#= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
      <%#= link_to "更多", news_url_in_org(activity.id), :class => "more-btn", :target => "_blank" %> @@ -130,7 +130,7 @@ <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
      - <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %> + <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %> <%#= link_to activity.description.to_s.html_safe, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
      @@ -151,7 +151,7 @@ <% end %>
      - <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.content, :maxheight=>54, :maxwordsnum => 28} %> + <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.content, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %> <%#= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
      @@ -168,7 +168,7 @@ <%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
      - <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %> + <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %> <%#= link_to activity.content.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
      <%#= link_to "更多", news_url_in_org(activity.id), :class => "more-btn", :target => "_blank" %> @@ -214,7 +214,7 @@ <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-title sn-hidden" %>
      - <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight=>54, :maxwordsnum => 28} %> + <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %> <%#= link_to document.content.to_s.html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-tag" %>
      <%#= link_to "更多", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :class => "more-btn", :target => "_blank" %> @@ -244,7 +244,7 @@ <% end %>
      - <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %> + <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %> <%#= link_to content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
      <%#= link_to "更多", board_message_url_in_org(message.board.id,message.id), :class => "more-btn", :target => "_blank" %> @@ -264,7 +264,7 @@ <% end %>
      - <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %> + <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %> <%#= link_to content.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-tag" %>
      <%#= link_to "更多", board_message_path(message.board,activity), :class => "more-btn", :target => "_blank" %> @@ -285,7 +285,7 @@
      <%#= link_to news.description.to_s.html_safe, news_path(news), :target => '_blank', :class => "resources-tag" %> - <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => news.id, :content=> news.description, :maxheight=>54, :maxwordsnum => 28, :maxwordsnum => 28} %> + <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => news.id, :content=> news.description, :maxheight=>54, :maxwordsnum => 28, :maxwordsnum => 28, :maxwidth=>0} %>
      <%#= link_to "更多", news_path(news), :class => "more-btn", :target => "_blank" %> diff --git a/app/views/users/_course_boardlist.html.erb b/app/views/users/_course_boardlist.html.erb index bf23d9a97..5cb2c27a7 100644 --- a/app/views/users/_course_boardlist.html.erb +++ b/app/views/users/_course_boardlist.html.erb @@ -31,9 +31,6 @@ <% end %> <% u = User.where("id=?",activity.author_id).first%> - - 发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> -
      @@ -42,11 +39,13 @@ <% else %> <% content = activity.parent.content %> <% end %> -

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

      +

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

      - 发帖:<%= format_time(activity.created_on) %> - 更新:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> + + 发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> + + 更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %> <% count=0 %> <% if activity.parent %> <% count=activity.parent.children.count%> diff --git a/app/views/users/_course_newslist.html.erb b/app/views/users/_course_newslist.html.erb index 0e5805112..87dbe6b95 100644 --- a/app/views/users/_course_newslist.html.erb +++ b/app/views/users/_course_newslist.html.erb @@ -24,16 +24,15 @@ <% end%> <% u = User.where("id=?",activity.author_id).first%> - - 发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> -
      -

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

      +

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

      - 发布:<%= format_time(activity.created_on) %> + + 发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> + 更新:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> <% count=0 %> <% count=activity.comments.count %> diff --git a/app/views/users/_intro_content_ex.html.erb b/app/views/users/_intro_content_ex.html.erb index e3baf3fe2..082d0cb94 100644 --- a/app/views/users/_intro_content_ex.html.erb +++ b/app/views/users/_intro_content_ex.html.erb @@ -12,6 +12,11 @@ $("#activity_description_<%= user_activity_id%>").css("max-height", heightType + "px"); } + var maxWidth = <%= maxwidth %> + if (maxWidth > 0) { + $("#intro_content_<%= user_activity_id%>").css("max-width", maxWidth + "px"); + } + description_showwords_ellipsis(<%=user_activity_id %>,<%= maxwordsnum %>); }); \ No newline at end of file diff --git a/app/views/users/_project_boardlist.html.erb b/app/views/users/_project_boardlist.html.erb index 25fd675fb..fe7bc03f2 100644 --- a/app/views/users/_project_boardlist.html.erb +++ b/app/views/users/_project_boardlist.html.erb @@ -31,9 +31,6 @@ <% end %> <% u = User.where("id=?",activity.author_id).first%> - - 发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> -
      @@ -42,11 +39,13 @@ <% else %> <% content = activity.parent.content %> <% end %> -

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

      +

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

      - 发帖:<%= format_time(activity.created_on) %> - 更新:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> + + 发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> + + 更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %> <% count=0 %> <% if activity.parent %> <% count=activity.parent.children.count%> diff --git a/app/views/users/_user_course_list.html.erb b/app/views/users/_user_course_list.html.erb index 5e3f48963..ea8f3fc40 100644 --- a/app/views/users/_user_course_list.html.erb +++ b/app/views/users/_user_course_list.html.erb @@ -24,7 +24,7 @@ <% teacher = User.where("id=?",course.tea_id).first%> <%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %> - +
    • diff --git a/public/javascripts/create_kindeditor.js b/public/javascripts/create_kindeditor.js index 2ff5336e1..d6fc52a8d 100644 --- a/public/javascripts/create_kindeditor.js +++ b/public/javascripts/create_kindeditor.js @@ -25,7 +25,7 @@ function sd_create_editor(params){ var edit = this.edit; var body = edit.doc.body; edit.iframe.height(paramsHeight); - this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight)); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight+7)) , paramsHeight)); }, afterBlur:function(){ //params.toolbar_container.hide(); diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 2ca221d5c..c7fa7d60c 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -24,9 +24,9 @@ table{ background:#fff;} a.btn_message_free{ background:#ff5722; display:block; text-align:center; color:#fff; padding:3px 0; width:80px; margin-bottom:10px;} .db {display:block;} /* font & color */ -h2{ font-size:18px; color:#15bccf;} -h3{ font-size:14px; color:#e8770d;} -h4{ font-size:14px; color:#3b3b3b;} +h2{ font-size:18px; } +h3{ font-size:14px; } +h4{ font-size:14px; } .f12{font-size:12px; font-weight:normal;} .f14{font-size:14px;} .f16{font-size:16px;} @@ -1139,4 +1139,4 @@ a.st_down{ display: block; width:8px; float:left; height:13px; background:url(.. .likeNum{color: #7f7f7f} /*弹框*/ -.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-bottom:10px;} +.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-bottom:10px;} diff --git a/public/stylesheets/public_new.css b/public/stylesheets/public_new.css index 56c867829..ec0290918 100644 --- a/public/stylesheets/public_new.css +++ b/public/stylesheets/public_new.css @@ -22,9 +22,9 @@ table{ background:#fff;} .none{display: none;} /* font & color */ -h2{ font-size:18px; color:#15bccf;} -h3{ font-size:14px; color:#e8770d;} -h4{ font-size:14px; color:#3b3b3b;} +h2{ font-size:18px; } +h3{ font-size:14px; } +h4{ font-size:14px; } .f12{font-size:12px; font-weight:normal;} .f14{font-size:14px;} .f16{font-size:16px;} From a3abf098419e77605be9b5f152553d2fef30b6f9 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 23 May 2016 16:04:06 +0800 Subject: [PATCH 12/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 13/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 14/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 e7d20c2b985ddbc1339e3eb7765d2e70b980f664 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 24 May 2016 09:11:50 +0800 Subject: [PATCH 15/76] =?UTF-8?q?1.=E9=A1=B9=E7=9B=AE=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E3=80=81=E8=AF=BE=E7=A8=8B=E7=95=99=E8=A8=80?= =?UTF-8?q?=E5=8C=BA=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E8=AF=86=E5=88=AB?= =?UTF-8?q?URL=E5=8A=9F=E8=83=BD=202.=E6=89=80=E6=9C=89=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AF=86=E5=88=ABURL=E5=8C=BA=E5=9F=9F=E7=9A=84=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E9=A2=9C=E8=89=B2=E9=83=BD=E6=94=B9=E4=B8=BA#15bccf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/show.html.erb | 3 +++ app/views/courses/_history.html.erb | 14 +++++++++++--- app/views/projects/_history.html.erb | 10 +++++++++- app/views/words/_journal_reply_items.html.erb | 17 ++++++++++++----- public/stylesheets/courses.css | 8 ++++++-- public/stylesheets/css.css | 2 +- public/stylesheets/new_user.css | 4 ++++ public/stylesheets/project.css | 5 ++++- public/stylesheets/public.css | 2 ++ 9 files changed, 52 insertions(+), 13 deletions(-) diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index d3763abf3..72c5dce1e 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -215,6 +215,9 @@ $(function(){ var postContent = $("#message_description_<%= @article.id %>").html(); postContent = postContent.replace(/ /g," "); + postContent= postContent.replace(/ {2}/g,"  "); + postContent=postContent.replace(/   /g,"   "); + postContent=postContent.replace(/  /g,"   "); $("#message_description_<%= @article.id %>").html(postContent); autoUrl('message_description_<%= @article.id %>'); }); diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index 864509546..b93cbc3c6 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -15,9 +15,11 @@ <%= format_time(journal.created_on) %>
      -

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

      +
      +

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

      +
      @@ -49,6 +51,12 @@
      + <% end %> <% end %> diff --git a/app/views/projects/_history.html.erb b/app/views/projects/_history.html.erb index b31445fdc..e8d08de3d 100644 --- a/app/views/projects/_history.html.erb +++ b/app/views/projects/_history.html.erb @@ -10,7 +10,9 @@ <%= format_time(journal.created_on) %>
      -

      <%=journal.notes.html_safe%> +

      +

      <%=journal.notes.html_safe%>

      +
      <% ids = 'project_respond_form_'+ journal.id.to_s%> @@ -42,6 +44,12 @@
      + <% end %> <% end %> diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index db848d2cd..e0d52479d 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -20,10 +20,11 @@ <% else %> <%= l(:label_anonymous) %> <% end %> - -

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

      +
      +

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

      +
      <%= format_time reply.created_on %> @@ -52,4 +53,10 @@
      -<% end %> \ No newline at end of file +<% end %> + \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 08981ae54..7e64a27c2 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -139,6 +139,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;} .homepagePostTitle td,.homepagePostTitle tr {border: 1px solid; border-color: inherit;} +.homepagePostTitle a{color: #15bccf;} .homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} @@ -146,7 +147,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} - +.homepagePostIntro a{color: #15bccf;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} .homepagePostReply {width:710px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;} @@ -188,6 +189,7 @@ a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} .homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} +.homepagePostReplyContent a{color: #15bccf;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} @@ -435,6 +437,7 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_dispic a{ display:block; height:46px; width:46px; border:1px solid #CCC; padding:1px; float:left;} .ping_dispic a:hover{border:1px solid #15bccf;} .ping_discon{ float:left; width:610px; margin-left:10px; } +.ping_journal a{color: #15bccf;} /*.ping_distop span{ float:left;}*/ .ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;} .ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;} @@ -1131,7 +1134,8 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} .postDetailDes ol li{list-style-type: decimal;margin-left: 40px;} .postDetailDes ul li{list-style-type: disc;margin-left: 40px;} -.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} +.postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;} +.postDetailDes a{color: #15bccf;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; } .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index 3e21a5fda..74a9d9aaf 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -123,7 +123,7 @@ a:hover.ping_sub{ background:#14a8b9;} .list_style ol li{list-style-type: decimal;margin-left: 40px;} .list_style ul li{list-style-type: disc;margin-left: 40px;} .ping_distop span a{ float:right; /*width:20px;*/ height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;} - +.ping_journal a{color: #15bccf;} /* 创建作业 */ .Newwork{ width:940px; border:1px solid #c3c3c3;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 326d2897b..ba3afd79b 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -673,6 +673,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;} .homepagePostTitle td,.homepagePostTitle tr {border: 1px solid; border-color: inherit;} +.homepagePostTitle a{color: #15bccf;} .homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} @@ -683,6 +684,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} +.homepagePostIntro a{color: #15bccf;} .homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;} .borderBottomNone {border-bottom:none !important;} .homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} @@ -722,6 +724,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;} .homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} +.homepagePostReplyContent a{color: #15bccf;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} @@ -866,6 +869,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re .postDetailDes ol li{list-style-type: decimal;margin-left: 40px;} .postDetailDes ul li{list-style-type: disc;margin-left: 40px;} .postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;} +.postDetailDes a{color: #15bccf;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; } /*line-height: 18px !important;*/ .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 09f7075f7..6baf0386d 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -332,6 +332,7 @@ a:hover.ping_sub{ background:#14a8b9;} /*.ping_distop span{ float:left;}*/ .ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;} .ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;} +.ping_journal a{color: #15bccf;} /*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/ .list_style ol li{list-style-type: decimal;margin-left: 40px;} .list_style ul li{list-style-type: disc;margin-left: 40px;} @@ -974,6 +975,7 @@ a:hover.Reply_pic{border:1px solid #64bdd9;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} +.homepagePostIntro a{color: #15bccf;} .topBorder { border-top: 1px solid #E4E4E4; } @@ -1114,7 +1116,8 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} .postDetailDes ol li{list-style-type: decimal;margin-left: 40px;} .postDetailDes ul li{list-style-type: disc;margin-left: 40px;} -.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} +.postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;} +.postDetailDes a{color: #15bccf;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index c7fa7d60c..98fa11b99 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -611,6 +611,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} +.homepagePostIntro a{color: #15bccf;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} .homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;} @@ -647,6 +648,7 @@ a.postReplyCancel:hover {color:#ffffff;} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;} .homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} +.homepagePostReplyContent a{color: #15bccf;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#15bccf;} From 2a0b35a1b393252ba1ad45df76f55b959b3d1312 Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 24 May 2016 09:38:49 +0800 Subject: [PATCH 16/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 17/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 18/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 29ceb7b8e961c76bb1942e7ef174e4441494ce4f Mon Sep 17 00:00:00 2001 From: txz Date: Tue, 24 May 2016 15:01:26 +0800 Subject: [PATCH 19/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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#)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~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{6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|f$mP!CdTv2 ziJi~7Je)_3(>l(t$@&j~Mc$rh3R6FAjnu>v`zl)@ac*H2|BBZVh||9_Y3V_xe3Uw9 zAN>zIM=?V(bUNCFX&pH*9#@3Mx$(nWe`%i@FJK$l!h?0$spxMIy`1+GAr0cvoQ3Le zmG2-G+S}|Xu{WnU8Xc=Ki^5Zhp}2M1Zz5stZ8K-!fixj*W$BpA>Bz>e*;${LIhT&I z#C&|pN_H_cZm%t3hY)VR=JL=j@bku0_y&8(;*;%s8ZT+G{El6m=lrm(kqnl%M1VqinFF z3%Z4PC?j#&B(_g4`g$Tc%S%utwynRY3y_BcB+pHLk|*&K4qon#5P@>wg_Lm${%fyC z4I!GJwLbMen<4E7^pO7eK!|ZlLK!W}>r?^_Lyy$#89hqq7 z7MO(`T^)Dfkx8|W=$q72;qGRcx)&mNJpz<{ieE$-7VLYhqh8_t{8GzO++VxR+uoBE zbcX=;E7uYS9wo)DA^#9INe>=N&JQ+GNW{c^EB&8?yu(+?wM?D}6I3SM%xYEP2RbRyO!hgQHp+u?^U2vgd4ENhss(uue0N zkRy|GU6#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;sxLFpyf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I$ zxb5o1_24hc3v;E)Yb~#;7dNE(F{@LpC?26 zYAR2?4c2AsqYoeSheXEVPhnb@t3du4E@9S}(%fSAEbDe07{2Fug{tz=E=I*JOhNOJ zCww5MF7mUID6)V}cEtN&SKQ+&{NA^alElD>>Af2hoL2@fJG_SNKlq)aIpun6?EaUo zaEa*g{1mu#DmMoj2;hz;ef@+fkd!d*cP=mkAbZ4X8qGdN-+* zuFswpSOa)je5TlsUHYRfezu=70IDXnBYRq{}flnz(9SCWXX+!CGLoAd71 z0WU4=2W1P3RTo)_W*%YwT`2$81U-5~r_`*Moq(oQ^gD-ToBL%m){=)B*3U?HKNM$x zLcnjh*3ByTetM>JgFP4#9ab}uF9%A2qWSDyw+}U2%(#t~+&bgyCYjsRRo>8iLHPKs zx#)?XY-h%)4C3^8!FAyR;Y~zK)c|DW`aU@!)1Hd=H-dIMy|CcuZ_d-z`X6#qw|$(B zrp;=Wi*k<%NO$H8N|Y$VmGt`z0$si&;Kh9pscf&MPCkkp@-SJOioQ0u%9Ur9y6*h2 zd?jcXnnm$%m-16PIr|eg-{6wWv-<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 a7a2be6a4bec789dc0e50ee6076dcac281fdaa28 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 24 May 2016 16:01:02 +0800 Subject: [PATCH 20/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 9e8411aac978e573bf94e593ef50916d0a6a23be Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 24 May 2016 16:22:46 +0800 Subject: [PATCH 21/76] =?UTF-8?q?=E4=BF=AE=E6=94=B9ke=EF=BC=9Aissue?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E5=8F=AA=E6=9C=89=E4=B8=80=E8=A1=8C=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=BC=96=E8=BE=91=E5=90=8E=EF=BC=8C=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E6=A1=86=E8=A2=AB=E6=8B=89=E9=AB=98=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E6=9C=89=E5=BE=88=E5=A4=9A=E7=A9=BA=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/plugins/autoheight/autoheight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/kindeditor/plugins/autoheight/autoheight.js b/public/assets/kindeditor/plugins/autoheight/autoheight.js index 82928ff0c..cdd3f94f8 100644 --- a/public/assets/kindeditor/plugins/autoheight/autoheight.js +++ b/public/assets/kindeditor/plugins/autoheight/autoheight.js @@ -41,7 +41,7 @@ KindEditor.plugin('autoheight', function(K) { var body = edit.doc.body; edit.iframe.height(minHeight); self.resize(null, Math.max( - ((K.IE ? body.scrollHeight : body.offsetHeight) > 500 ? 500 : (K.IE ? body.scrollHeight : body.offsetHeight)) //限制初始化太高的情况 + ((K.IE ? body.scrollHeight : body.offsetHeight) > 250 ? 250 : (K.IE ? body.scrollHeight : body.offsetHeight)) //限制初始化太高的情况 + 33, minHeight)); } From 7b7f9cf8f2b108777a974955fc62c8aecf97fb84 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 24 May 2016 19:52:51 +0800 Subject: [PATCH 22/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 23/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 | 208 +++++++++--------- 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, 176 insertions(+), 129 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(",") + ")" + if User.current == @user + @page = params[:page] ? params[:page].to_i + 1 : 0 + user_course_ids = @user.courses.empty? ? "(-1)" :"(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" - #判断当前用户在当前课程的身份 - visibleCourse = @user.courses.empty? ? [] : @user.courses.where("is_delete = 0").visible - homework_ids = [] - visibleCourse.each do |course| - homeworks = HomeworkCommon.where("course_id = #{course.id} and publish_time <= '#{Date.today}'") - homework_ids << homeworks.pluck(:id) unless homeworks.empty? - end - visible_homework_ids = homework_ids.size == 0 ? "(-1)" :"(" + homework_ids.join(",") + ")" - @homework_commons = HomeworkCommon.where("id in #{visible_homework_ids}").order("created_at desc").limit(10).offset(@page * 10) - @is_teacher = User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true) - @is_in_course = params[:is_in_course].to_i || 0 - respond_to do |format| - format.js - format.html {render :layout => 'new_base_user'} - end - else - render_403 + #判断当前用户在当前课程的身份 + visibleCourse = @user.courses.empty? ? [] : @user.courses.where("is_delete = 0").visible + homework_ids = [] + visibleCourse.each do |course| + homeworks = HomeworkCommon.where("course_id = #{course.id} and publish_time <= '#{Date.today}'") + homework_ids << homeworks.pluck(:id) unless homeworks.empty? end + visible_homework_ids = homework_ids.size == 0 ? "(-1)" :"(" + homework_ids.join(",") + ")" + @homework_commons = HomeworkCommon.where("id in #{visible_homework_ids}").order("created_at desc").limit(10).offset(@page * 10) + @is_teacher = User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true) + @is_in_course = params[:is_in_course].to_i || 0 + respond_to do |format| + format.js + format.html {render :layout => 'new_base_user'} + end + else + render_403 + end end def choose_user_course @@ -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 - # @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 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 24/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 25/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 46860a838baa5e9b2c7759256700e86022eb01d2 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Wed, 25 May 2016 10:34:09 +0800 Subject: [PATCH 26/76] =?UTF-8?q?1.=E8=AE=BE=E7=BD=AE=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E5=90=8E=E6=89=80=E6=9C=89=E7=9A=84=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E7=BA=BF=E5=AE=BD=E5=BA=A6=E9=83=BD=E4=B8=80=E6=A0=B7?= =?UTF-8?q?=202.KE=E6=94=B9=E5=8F=98=E5=AD=97=E4=BD=93=E5=90=8E=E5=86=8D?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=AD=97=E4=BD=93=E4=BC=9A=E6=A0=87=E6=98=8E?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=9A=84=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 5 +++-- public/assets/kindeditor/plugins/code/previewcode.css | 6 +++--- public/assets/kindeditor/plugins/table/table.js | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index a8c17345b..39ce0abdb 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -297,7 +297,7 @@ K.options = { 'td,th': [ 'id', 'class', 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight', - '.font-style', '.text-decoration', '.vertical-align', '.background', '.border', '.text-overflow','.overflow','.white-space' + '.font-style', '.text-decoration', '.vertical-align', '.background', '.border','.border-color', '.text-overflow','.overflow','.white-space' ], a : ['id', 'class', 'href', 'target', 'name'], embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'], @@ -2539,7 +2539,8 @@ function _nativeCommand(doc, key, val) { function _nativeCommandValue(doc, key) { var val = ''; try { - val = doc.query_nativeCommand(self.doc, name, val);Value(key); +// val = doc.query_nativeCommand(self.doc, name, val);Value(key); + val = doc.queryCommandValue(key); } catch (e) {} if (typeof val !== 'string') { val = ''; diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index 65c75d6ea..352c77625 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -1,7 +1,7 @@ .ke-content { - font-size: 12px; - font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢���ź�, ����; - font-family:Tahoma; + font-size: 14px; + /*font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;*/ + font-family: "微软雅黑","宋体"; } .ke-content pre { font-size:9pt; diff --git a/public/assets/kindeditor/plugins/table/table.js b/public/assets/kindeditor/plugins/table/table.js index be386f7cc..74b14b118 100644 --- a/public/assets/kindeditor/plugins/table/table.js +++ b/public/assets/kindeditor/plugins/table/table.js @@ -257,6 +257,7 @@ KindEditor.plugin('table', function(K) { style += 'border-color:'+borderColor+';'; } style += 'table-layout: '+'fixed;'; + style += 'border-collapse: collapse;'; var html = '') + ''; + html += '' + (K.IE ? ' ' : '
            ') + ''; } html += ''; } From fcaa9666e2744537265d8f391c36f1dc944e46ae Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Wed, 25 May 2016 10:37:35 +0800 Subject: [PATCH 27/76] =?UTF-8?q?KE=E5=86=85=E5=AE=B9=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E7=BD=91=E5=9D=80=E5=8A=A0=E4=B8=8A=E8=B6=85?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=97=B6=E6=8A=8A=E9=A2=9C=E8=89=B2=E4=B9=9F?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/application.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index aec0af070..01bb164a9 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1327,10 +1327,10 @@ function autoUrl(id){ var reStr = full; if (full.length > 0){ if (full.indexOf("://") >= 0){ - reStr = ""+full+""; + reStr = ""+full+""; } else{ - reStr = ""+full+""; + reStr = ""+full+""; } } return reStr ; @@ -1346,10 +1346,10 @@ function autoUrl(id){ var reStr = full; if (full.length > 0){ if (full.indexOf("://") >= 0){ - reStr = ""+full+""; + reStr = ""+full+""; } else{ - reStr = ""+full+""; + reStr = ""+full+""; } } return reStr ; From 72ae31b7f989b21b80eae84131a7a237eecea94f Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 11:23:19 +0800 Subject: [PATCH 28/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 29/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 30/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%>", + url: '<%= search_user_course_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>", + data:{send_type:'file'} + }); + }else if (lastSendType === '3'){ + $.ajax({ + type: 'get', + url: '<%= search_user_org_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>", + data:{send_type:'file'} + }); + } + else{ + $.ajax({ + type: 'get', + url: '<%= search_user_course_user_path(User.current.id)%>' + '?'+ $("#resources_list_form").serialize() + "&type=<%= @type %>", data:{send_type:'file'} }); 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 31/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 32/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 192258a82d9a025d747f10f911c94311c771cbc3 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Wed, 25 May 2016 17:04:46 +0800 Subject: [PATCH 33/76] =?UTF-8?q?1.=E5=8F=96=E6=B6=88KE=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=97=B6=E5=80=99=E6=AE=B5=E8=90=BD=E7=9A=84=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E8=BE=B9=E8=B7=9D=202.=E5=85=88=E7=BC=96=E5=8F=B7=E5=90=8E?= =?UTF-8?q?=E6=AE=B5=E8=90=BD=20=E5=8F=AF=E4=BB=A5=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=AE=B5=E8=90=BD=E6=A0=B7=E5=BC=8F=20=20=E6=AD=A3=E6=96=87?= =?UTF-8?q?=E8=BF=98=E4=B8=8D=E8=83=BD=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 11 ++++++++++- public/assets/kindeditor/plugins/code/previewcode.css | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 39ce0abdb..6b0f1621b 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -3311,6 +3311,7 @@ _each(('formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull if (!_IERANGE || _inArray(name, 'formatblock,selectall,insertorderedlist,insertunorderedlist'.split(',')) >= 0) { self.selection(); } + return self; }; }); @@ -5752,7 +5753,7 @@ _plugin('core', function(K) { h2 : 24, h3 : 18, H4 : 14, - p : 12 + p : 12 }, curVal = self.cmd.val('formatblock'), menu = self.createMenu({ @@ -5770,6 +5771,14 @@ _plugin('core', function(K) { checked : (curVal === key || curVal === val), click : function() { self.select().exec('formatblock', '<' + key + '>').hideMenu(); + //by yk利用html的特性使h1 h2 h3 h4标签之间不能相互包含 并将空的标签去掉 + if (key != "p"){ + var val = self.select().html(); + self.select().html(val); + val = self.select().html().replace(/(

            \s*<\/h1>)|(

            \s*<\/h2>)|(

            \s*<\/h3>)|(

            \s*<\/h4>)/g,""); + self.select().html(val); + self.select(); + } } }); }); diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index 352c77625..459fbd5d6 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -53,4 +53,4 @@ span.at a{color:#269ac9;text-decoration: none;} /*yk*/ .ke-content ol li{list-style-type: decimal;} .ke-content ul li{list-style-type: disc;} -.ke-content ol,.ke-content ul{margin-top:0;margin-bottom: 0;} \ No newline at end of file +.ke-content ol,.ke-content ul,.ke-content h1,.ke-content h2,.ke-content h3,.ke-content h4{margin-top:0;margin-bottom: 0;} \ No newline at end of file From 0a7d1f1efc3faedb2ef250eaaf487b38311aa681 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 25 May 2016 17:54:53 +0800 Subject: [PATCH 34/76] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BA=93=E6=B7=BB=E5=8A=A0=E8=B5=84=E6=BA=90=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E3=80=81=E8=AF=BE=E7=A8=8B=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E5=8F=91=E9=80=81=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++- app/views/users/_org_file_form.html.erb | 2 +- app/views/users/_project_file_form.html.erb | 2 +- .../users/_resource_share_for_orgs.html.erb | 4 +-- ..._resource_share_for_project_popup.html.erb | 2 +- .../users/_resource_share_popup.html.erb | 9 +++--- app/views/users/_user_resource_info.html.erb | 2 +- app/views/users/search_user_project.js.erb | 2 -- public/javascripts/application.js | 30 +++++++++++++++++++ 9 files changed, 43 insertions(+), 14 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 121b93dc5..fa286b43b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2105,7 +2105,8 @@ class UsersController < ApplicationController project_ids.each do |project_id| next if ori.blank? @exist = false - Project.find(project_id).attachments.each do |att| #如果课程中包含该资源 + # 如果对象中包含该资源 + Project.find(project_id).attachments.each do |att| if att.id == ori.id || (!att.copy_from.nil? && !ori.copy_from.nil? && att.copy_from == ori.copy_from) || att.copy_from == ori.id || att.id == ori.copy_from att.created_on = Time.now att.save @@ -3126,6 +3127,7 @@ class UsersController < ApplicationController @orgs = @user.organizations.select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0} end end + @type = params[:type] @search = params[:search] #这里仅仅是传递需要发送的资源id @send_id = params[:send_id] diff --git a/app/views/users/_org_file_form.html.erb b/app/views/users/_org_file_form.html.erb index 348a68c00..b4a7bc6ef 100644 --- a/app/views/users/_org_file_form.html.erb +++ b/app/views/users/_org_file_form.html.erb @@ -1,4 +1,4 @@ -<%= form_tag add_exist_file_to_org_user_path(user, :type => defined?(type) ? type : "6" ),:remote=>true,:id=>'orgs_list_form' do %> +<%= form_tag add_exist_file_to_org_user_path(user, :type => @type ),:remote=>true,:id=>'orgs_list_form' do %> <%= hidden_field_tag(:send_id, send_id) %> <%= hidden_field_tag(:send_ids, send_ids) %>
            diff --git a/app/views/users/_project_file_form.html.erb b/app/views/users/_project_file_form.html.erb index 74e8fecc2..413ffa17a 100644 --- a/app/views/users/_project_file_form.html.erb +++ b/app/views/users/_project_file_form.html.erb @@ -1,4 +1,4 @@ -<%= form_tag add_exist_file_to_project_user_path(user, :type => defined?(type) ? type : "6" ), :remote => true, :id => 'projects_list_form' %> +<%= form_tag add_exist_file_to_project_user_path(user, :type => @type ), :remote => true, :id => 'projects_list_form' %>
            <%= hidden_field_tag(:send_id, send_id) %> <%= hidden_field_tag(:send_ids, send_ids) %> diff --git a/app/views/users/_resource_share_for_orgs.html.erb b/app/views/users/_resource_share_for_orgs.html.erb index 54ff83684..b1736a378 100644 --- a/app/views/users/_resource_share_for_orgs.html.erb +++ b/app/views/users/_resource_share_for_orgs.html.erb @@ -7,7 +7,7 @@
            - <%= form_tag search_user_org_user_path(user),:method => 'get', + <%= form_tag search_user_org_user_path(user, :type => @type),:method => 'get', :remote=>true,:id=>'search_user_org_form' do %> <%= hidden_field_tag(:send_id, send_id) %> <%= hidden_field_tag(:send_ids, send_ids) %> @@ -19,5 +19,5 @@
            - <%= render :partial => 'users/org_file_form', :locals => {:user => user, :orgs => @orgs, :send_id => send_id, :send_ids => send_ids, :type => type} %> + <%= render :partial => 'users/org_file_form', :locals => {:user => user, :orgs => @orgs, :send_id => send_id, :send_ids => send_ids, :type => @type} %>
            diff --git a/app/views/users/_resource_share_for_project_popup.html.erb b/app/views/users/_resource_share_for_project_popup.html.erb index c758ef492..23be825da 100644 --- a/app/views/users/_resource_share_for_project_popup.html.erb +++ b/app/views/users/_resource_share_for_project_popup.html.erb @@ -12,7 +12,7 @@

        - <%= form_tag search_user_project_user_path(user),:method => 'get', + <%= form_tag search_user_project_user_path(user, :type => @type),:method => 'get', :remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %> <%= hidden_field_tag(:send_id, send_id) %> <%= hidden_field_tag(:send_ids, send_ids) %> diff --git a/app/views/users/_resource_share_popup.html.erb b/app/views/users/_resource_share_popup.html.erb index 3895446f1..93e0d0c47 100644 --- a/app/views/users/_resource_share_popup.html.erb +++ b/app/views/users/_resource_share_popup.html.erb @@ -4,7 +4,7 @@
        发送到
        - @@ -14,10 +14,9 @@
        - <%= form_tag search_user_course_user_path(user),:method => 'get', - :remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %> - <%= hidden_field_tag(:send_id, send_id) %> - <%= hidden_field_tag(:send_ids, send_ids) %> + <%= form_tag search_user_course_user_path(user),:method => 'get', :remote=>true, :id=> 'search_user_course_form', :class=> 'resourcesSearchBox' do %> + <%= hidden_field_tag(:send_id, send_id) %> + <%= hidden_field_tag(:send_ids, send_ids) %>
        <%= format_time reply.created_on %> @@ -57,9 +63,3 @@
        <% end %> - From 622d71c47654b12f310a85231fe350b14ed2a4c5 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 27 May 2016 22:14:41 +0800 Subject: [PATCH 62/76] =?UTF-8?q?=E5=B7=B2=E7=BB=91=E5=AE=9A=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E7=9A=84=EF=BC=8C=E7=9B=B4=E6=8E=A5=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 4 +++- app/views/wechats/login.html.erb | 23 ++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 43bab082a..30a39e86e 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -162,7 +162,6 @@ class WechatsController < ActionController::Base code = params[:code] || session[:wechat_code] openid = get_openid_from_code(code) - raise "无法获取到微信openid" unless openid render :json => {status:0, openid: openid} rescue Exception=>e @@ -197,6 +196,9 @@ class WechatsController < ActionController::Base def login session[:wechat_code] = params[:code] if params[:code] + openid = get_openid_from_code(code) + @wechat_user = user_binded?(openid) + render 'wechats/login', layout: 'base_wechat' end diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index dc39b9f23..6de7b9bd8 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -1,4 +1,22 @@ +<% if @wechat_user %> +
        +
        +
        +
        +

        操作成功

        +

        您已经绑定过微信了,用户名: (<%= @wechat_user.user.login %>)

        +
        +
        +

        + 确定 +

        +
        + +
        +
        + +<% else %>

        @@ -63,4 +81,7 @@ }) }); - \ No newline at end of file + + + +<% end %> \ No newline at end of file From 4561bdfd0deae1eb761a8455b9f9ad831daffff5 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 27 May 2016 22:18:03 +0800 Subject: [PATCH 63/76] code=>params[:code] --- app/controllers/wechats_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 30a39e86e..8570d3140 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -196,7 +196,7 @@ class WechatsController < ActionController::Base def login session[:wechat_code] = params[:code] if params[:code] - openid = get_openid_from_code(code) + openid = get_openid_from_code(params[:code]) @wechat_user = user_binded?(openid) render 'wechats/login', layout: 'base_wechat' From be94d445a947aec1054a15c40e7742643d81a8f1 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 27 May 2016 22:19:49 +0800 Subject: [PATCH 64/76] window close --- app/views/wechats/login.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index 6de7b9bd8..65a8b1857 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -9,7 +9,7 @@

        From 63b9aaefe2c38424bba40a6eec81b164a948126d Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 27 May 2016 22:22:09 +0800 Subject: [PATCH 65/76] window close --- app/views/wechats/login.html.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index 65a8b1857..39e188664 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -1,5 +1,11 @@ <% if @wechat_user %> + +
        @@ -9,7 +15,7 @@
        From bb30709fa110dd96e787c15482e6bed159b67d14 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 27 May 2016 22:54:57 +0800 Subject: [PATCH 66/76] window close --- app/views/wechats/login.html.erb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index 39e188664..17878e318 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -1,11 +1,5 @@ <% if @wechat_user %> - -
        @@ -15,7 +9,7 @@
        From d4c0e9754ac6332a5af1fd5d2c7e5d8b0f153ff8 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 30 May 2016 14:51:54 +0800 Subject: [PATCH 67/76] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=90=8E=E5=BA=94=E6=98=BE=E7=A4=BA=E2=80=9C?= =?UTF-8?q?=E6=94=B6=E8=B5=B7=E6=8F=8F=E8=BF=B0=E4=BF=A1=E6=81=AF=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_courses.html.erb | 4 ++-- public/javascripts/course.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index a9e859448..c3f3a4a60 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -157,9 +157,9 @@
        - <%= l(:label_expend_information)%> + - +
        diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 7cfad6005..73ab065ea 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -475,6 +475,19 @@ function submitMemberSerch(content) function show_more_msg() { $("#course_description").toggleClass("course_description_none"); + var information = $("#expend_more_information"); + var arrow = $("#arrow"); + var val = information.attr("value"); + if (val == "show_more") { + $("#expend_more_information").text("收起描述信息"); + information.attr("value", "hide_more"); + arrow.attr("src", "/images/jiantouup.jpg") + } + else { + $("#expend_more_information").text("展开更多信息"); + information.attr("value", "show_more"); + arrow.attr("src", "/images/jiantou.jpg") + } } //作业描述显示更多信息 function news_show_more_des(id) From f024764e29b32d5cd5ac22588aea4bfb8dbf0644 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 30 May 2016 14:59:05 +0800 Subject: [PATCH 68/76] =?UTF-8?q?=E8=AF=BE=E5=86=85=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E7=9C=8B=E5=88=B0=E7=9A=84=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=E5=AD=A6=E7=94=9F=E2=80=9C=E5=A7=93=E5=90=8D=E2=80=9D?= =?UTF-8?q?=E4=B8=8D=E5=BA=94=E6=98=BE=E7=A4=BA=E6=98=B5=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_new_member_list.html.erb | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb index bff16e053..d8a2c6ed8 100644 --- a/app/views/courses/_new_member_list.html.erb +++ b/app/views/courses/_new_member_list.html.erb @@ -51,17 +51,9 @@ <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
          - <% if @canShowCode %> -
        • - <% if member.user.show_name == ''%> - <%= link_to("#{l(:label_bidding_user_studentname)}:#{member.user.name}".html_safe,user_path(member.user)) %> - <% else%> - <%= link_to("#{l(:label_bidding_user_studentname)}:#{member.user.show_name}".html_safe,user_path(member.user)) %> - <%end%> -
        • - <% else %> -
        • <%= link_to("#{l(:label_bidding_user_studentname)}:#{member.user.name}".html_safe, user_path(member.user)) %>
        • - <% end %> +
        • + <%= link_to("#{l(:label_bidding_user_studentname)}:#{member.user.show_name}".html_safe,user_path(member.user)) %> +

        • <% unless member.user.user_extensions.student_id == ''%>
        • <%= link_to("#{l(:label_bidding_user_studentcode)}:#{member.user.user_extensions.student_id}".html_safe,user_path(member.user)) %>
        • From acc323e46df6aa156e077f9e13519995945804f5 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 30 May 2016 18:35:47 +0800 Subject: [PATCH 69/76] =?UTF-8?q?issue7890=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 386e5733d..1ce834f61 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -10,14 +10,14 @@ class ZipdownController < ApplicationController #勿删 before_filter :authorize, :only => [:assort,:download_user_homework] SAVE_FOLDER = "#{Rails.root}/files" OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip" + MAX_PATH = 250 #统一下载功能 def download if User.current.logged? begin if params[:base64file] - file = Base64.decode64(params[:base64file]) - file = file.sub('*', '+') + file = decode64(params[:base64file]) send_file "#{OUTPUT_FOLDER}/#{file}", :filename => filename_for_content_disposition(file), :type => detect_content_type(file) else send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file]) @@ -125,7 +125,11 @@ class ZipdownController < ApplicationController end def encode64(str) - Base64.encode64(str).sub('+', '*') + Base64.urlsafe_encode64(str) + end + + def decode64(str) + Base64.urlsafe_decode64(str) end def zip_homework_common homework_common @@ -242,6 +246,12 @@ class ZipdownController < ApplicationController def zipping(zip_name_refer, files_paths, output_path, is_attachment=false, not_exist_file=[]) rename_zipfile = zip_name_refer ||= "#{Time.now.to_i.to_s}.zip" + # 文件名过长 + + if rename_zipfile.size > MAX_PATH + rename_zipfile = rename_zipfile[0,rename_zipfile.size-4][0,MAX_PATH-4] + rename_zipfile[-4,4] + end + zipfile_name = "#{output_path}/#{rename_zipfile}" Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name)) From 858ad47338e1b9d16dcf981f9c8eeb736c4121a4 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 30 May 2016 18:40:22 +0800 Subject: [PATCH 70/76] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=95=BF=E5=BA=A6?= =?UTF-8?q?=E5=AE=9A=E4=B8=BA50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 1ce834f61..d9a9e1def 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -10,7 +10,7 @@ class ZipdownController < ApplicationController #勿删 before_filter :authorize, :only => [:assort,:download_user_homework] SAVE_FOLDER = "#{Rails.root}/files" OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip" - MAX_PATH = 250 + MAX_PATH = 50 #统一下载功能 def download From c421933cf61748ccb166ce972503aa6b2070db55 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 31 May 2016 08:57:08 +0800 Subject: [PATCH 71/76] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/activities.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/mobile/apis/activities.rb b/app/api/mobile/apis/activities.rb index cbd43bb79..2275a550e 100644 --- a/app/api/mobile/apis/activities.rb +++ b/app/api/mobile/apis/activities.rb @@ -33,14 +33,14 @@ module Mobile shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id) shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id) page = params[:page] ? params[:page] : 0 - user_project_ids = (user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.map{|project| project.id}-shield_project_ids).join(",") + ")" - user_course_ids = (user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.map{|course| course.id}-shield_course_ids).join(",") + ")" + user_project_ids = (user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" + user_course_ids = (user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" course_types = "('Message','News','HomeworkCommon','Poll','Course')" project_types = "('Message','Issue','Project')" principal_types = "JournalsForMessage" watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(',')) user_ids = "(" + user.id.to_s + watched_user_ids + ")" - watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",") + watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? " " :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",") blog_ids = "(" + watched_user_blog_ids + ")" activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + From 79c106a1c6bd5f0e3d9e698304749d58a0315f16 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 31 May 2016 11:04:20 +0800 Subject: [PATCH 72/76] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/activities.rb | 20 ++------------------ public/assets/wechat/activities.html | 2 +- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/app/api/mobile/apis/activities.rb b/app/api/mobile/apis/activities.rb index 2275a550e..af17e0f44 100644 --- a/app/api/mobile/apis/activities.rb +++ b/app/api/mobile/apis/activities.rb @@ -13,28 +13,12 @@ module Mobile end post do user = UserWechat.find_by_openid(params[:openid]).user -=begin - shield_project_ids = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id) - shield_course_ids = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id) - page = params[:page] ? params[:page] : 0 - user_project_ids = (user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" - user_course_ids = (user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")" - course_types = "('Message','News','HomeworkCommon','Poll','Course')" - project_types = "('Message','Issue','ProjectCreateInfo')" - principal_types = "JournalsForMessage" - - blog_ids = "("+user.blog.id.to_s+","+((User.watched_by(user.id).count == 0 )? '0' :User.watched_by(user.id).map{|u| u.blog.id}.join(','))+")" - activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + - "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ - "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{user.id}) " + - "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc') -=end shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id) shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id) page = params[:page] ? params[:page] : 0 - user_project_ids = (user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" - user_course_ids = (user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" + user_project_ids = (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).join(",") + ")" + user_course_ids = (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" course_types = "('Message','News','HomeworkCommon','Poll','Course')" project_types = "('Message','Issue','Project')" principal_types = "JournalsForMessage" diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 1bab8dfb4..30b4dafaa 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -175,7 +175,7 @@
        -
        +
        From 796125bd1c70813f194eeb2f95eba76fe38b78ff Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 31 May 2016 14:18:40 +0800 Subject: [PATCH 73/76] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E7=AB=AF=E7=9A=84=E6=97=B6=E9=97=B4=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/api_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/api_helper.rb b/app/helpers/api_helper.rb index 49640d889..3f7adcfa6 100644 --- a/app/helpers/api_helper.rb +++ b/app/helpers/api_helper.rb @@ -182,7 +182,7 @@ module ApiHelper timeIntoFormat = 0 updateAtValue = "" if timePassed < 0 - updateAtValue = "时间有问题" + updateAtValue = "1分钟前" elsif timePassed < ONE_MINUTE updateAtValue = "1分钟前" elsif timePassed < ONE_HOUR From ed84783f260306c7f97ef0b57e33412c806cd73b Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 31 May 2016 17:03:50 +0800 Subject: [PATCH 74/76] =?UTF-8?q?=E7=A7=81=E6=9C=89=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=85=AC=E5=BC=80=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 4 ++-- .../_alert_open_student_works.html.erb | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index dd178a1ce..10431f01a 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -390,7 +390,7 @@ class StudentWorkController < ApplicationController student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')' end #开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表 - if @homework.is_open == 1 || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) + if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) if @order == 'lastname' @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name elsif @order == 'student_id' @@ -456,7 +456,7 @@ class StudentWorkController < ApplicationController @student_work_count = (search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count else - if @homework.is_open == 1 || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) + if (@homework.is_open == 1 &&@course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) if @order == 'lastname' @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name elsif @order == 'student_id' diff --git a/app/views/homework_common/_alert_open_student_works.html.erb b/app/views/homework_common/_alert_open_student_works.html.erb index ef8fe3d08..73c7f0b47 100644 --- a/app/views/homework_common/_alert_open_student_works.html.erb +++ b/app/views/homework_common/_alert_open_student_works.html.erb @@ -1,10 +1,20 @@
        - <% if @homework.is_open == 0 %> + <% if @homework.is_open == 0 && @homework.course.is_public == 1 %>

        公开作品

        本次作业的所有作品将对Trustie平台所有注册用户开放,请问是否确定公开作品?

        + <% elsif @homework.is_open == 0 && @homework.course.is_public == 0 %> +

        公开作品

        +

        + 该作业是私有课程的作业,公开作品后本次作业的所有作品将对课程内的所有学生开放,请问是否确定公开作品? +

        + <% elsif @homework.is_open == 1 && @homework.course.is_public == 0 %> +

        取消公开作品

        +

        + 您将取消“公开作品”的功能,该私有作业的作品将只在作业截止后对已提交作品的学生开放,请问是否确定? +

        <% else %>

        取消公开作品

        From 8540b48091997f29509e2ca9da2bea3adaccf9d8 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 31 May 2016 17:34:56 +0800 Subject: [PATCH 75/76] =?UTF-8?q?=E6=9C=AA=E7=BB=91=E5=AE=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E8=B4=A6=E5=8F=B7=E6=97=B6=E7=82=B9=E5=87=BB=E2=80=9C?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8A=A8=E6=80=81=E2=80=9D=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 8f00a2b96..1149ea131 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -1,10 +1,10 @@ var app = angular.module('wechat', ['ngRoute','ngCookies']); var apiUrl = '/api/v1/'; -var debug = false; //调试标志,如果在本地请置为true +var debug = true; //调试标志,如果在本地请置为true if(debug===true){ - //apiUrl = 'http://localhost:3000/api/v1/'; - apiUrl = 'https://www.trustie.net/api/v1/'; + apiUrl = 'http://localhost:3000/api/v1/'; + //apiUrl = 'https://www.trustie.net/api/v1/'; } app.factory('auth', function($http,$routeParams, $cookies, $q){ @@ -78,6 +78,9 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){ url: apiUrl+ "activities", data: {openid: auth.openid(), page: page} }).then(function successCallback(response) { + if(response.data.message == "undefined method `user' for nil:NilClass"){ + alert("请先绑定确实的用户账号"); + } $scope.current_page = 0; console.log($scope.current_page); console.log(response.data.page); From 0cc8cb9928a1ade5d069a2ca7897901160e2769c Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 1 Jun 2016 08:57:27 +0800 Subject: [PATCH 76/76] =?UTF-8?q?=E5=88=9A=E6=8F=90=E4=BA=A4=E7=9A=84?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E4=B8=BA?= =?UTF-8?q?=E2=80=9C=E5=88=9A=E5=88=9A=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/api_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/api_helper.rb b/app/helpers/api_helper.rb index 3f7adcfa6..fb1231287 100644 --- a/app/helpers/api_helper.rb +++ b/app/helpers/api_helper.rb @@ -182,7 +182,7 @@ module ApiHelper timeIntoFormat = 0 updateAtValue = "" if timePassed < 0 - updateAtValue = "1分钟前" + updateAtValue = "刚刚" elsif timePassed < ONE_MINUTE updateAtValue = "1分钟前" elsif timePassed < ONE_HOUR