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

This commit is contained in:
cxt 2016-05-13 20:07:49 +08:00
commit c25b63a254
3 changed files with 5 additions and 3 deletions

View File

@ -79,7 +79,7 @@ class OrgDocumentCommentsController < ApplicationController
def add_reply def add_reply
@document = OrgDocumentComment.find(params[:id]).root @document = OrgDocumentComment.find(params[:id]).root
@act = OrgActivity.find(params[:id]) @act = OrgActivity.find(params[:act_id])
@comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id]) @comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id])
@comment.content = params[:org_content] @comment.content = params[:org_content]
@document.children << @comment @document.children << @comment

View File

@ -2618,7 +2618,9 @@ class UsersController < ApplicationController
# 获取我的资源 # 获取我的资源
def get_my_resources author_id, user_course_ids, user_project_ids, order, score def get_my_resources author_id, user_course_ids, user_project_ids, order, score
unless author_id.to_i.to_s == author_id
author_id = User.find_by_login(author_id).id author_id = User.find_by_login(author_id).id
end
attachments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('OrgSubfield','Principal','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ attachments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('OrgSubfield','Principal','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"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)" + "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)" +
"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}") "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}")

View File

@ -1,2 +1,2 @@
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>"); $("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>"); sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>");