diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index d371ed4cb..664dc4cf5 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -438,6 +438,46 @@ class AttachmentsController < ApplicationController end end + def add_exist_file_to_org_subfield + file = Attachment.find(params[:file_id]) + org_subfields = params[:org_subfields][:org_subfield] + @message = "" + org_subfields.each do |org_subfield| + s = OrgSubfield.find(org_subfield) + if s.attachments.include?file + if @message && @message == "" + @message += l(:label_resource_subfield_prompt) + c.name + l(:label_contain_resource) + file.filename + l(:label_quote_resource_failed) + next + else + @message += "
" + l(:label_resource_subfield_prompt) + c.name + l(:label_contain_resource) + file.filename + l(:label_quote_resource_failed) + next + end + end + attach_copied_obj = file.copy + attach_copied_obj.tag_list.add(file.tag_list) # tag关联 + attach_copied_obj.container = s + attach_copied_obj.created_on = Time.now + attach_copied_obj.author_id = User.current.id + attach_copied_obj.copy_from = file.copy_from.nil? ? file.id : file.copy_from + if attach_copied_obj.attachtype == nil + attach_copied_obj.attachtype = 4 + end + @obj = s + @save_flag = attach_copied_obj.save + @save_message = attach_copied_obj.errors.full_messages + update_quotes attach_copied_obj + end + respond_to do |format| + format.js + end + rescue NoMethodError + @save_flag = false + @save_message = [] << l(:label_resource_subfield_empty_select) + respond_to do |format| + format.js + end + end + def update_quotes attachment if attachment.copy_from attachments = Attachment.find_by_sql("select * from attachments where copy_from = #{attachment.copy_from} or id = #{attachment.copy_from}") diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb index b92223edc..7c09e2cdf 100644 --- a/app/controllers/blog_comments_controller.rb +++ b/app/controllers/blog_comments_controller.rb @@ -118,6 +118,7 @@ class BlogCommentsController < ApplicationController @blogComment.content = @quote + @blogComment.content @blogComment.title = "RE: #{@article.title}" unless params[:blog_comment][:title] @article.children << @blogComment + @article.save @user_activity_id = params[:user_activity_id] user_activity = UserActivity.where("act_type='BlogComment' and act_id =#{@article.id}").first if user_activity diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 1b0ead141..aa0e1596f 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -36,17 +36,18 @@ class CoursesController < ApplicationController if !params[:name].nil? condition = "%#{params[:name].strip}%".gsub(" ","") end + limit = 15 course_org_ids = OrgCourse.find_by_sql("select distinct organization_id from org_courses where course_id = #{params[:id]}").map(&:organization_id) if course_org_ids.empty? - @orgs_not_in_course = Organization.where("(is_public or creator_id =?) and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(10) + @orgs_not_in_course = Organization.where("(is_public or creator_id =?) and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(limit) @org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count else course_org_ids = "(" + course_org_ids.join(',') + ")" - @orgs_not_in_course = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(10) + @orgs_not_in_course = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(limit) @org_count = Organization.where("id not in #{course_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count end # @course_count = Project.course_entities.visible.like(params[:name]).page(params[:page]).count - @orgs_page = Paginator.new @org_count, 10,params[:page] + @orgs_page = Paginator.new @org_count, limit,params[:page] @hint_flag = params[:hint_flag] #render :json => {:orgs => @orgs_not_in_course, :count => @org_count}.to_json respond_to do |format| diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 328446fbb..68f7cc9cb 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -131,6 +131,45 @@ class FilesController < ApplicationController end end + def search_files_in_subfield + sort = "" + @sort = "" + @order = "" + @is_remote = true + @q = params[:name].strip + if params[:sort] + order_by = params[:sort].split(":") + @sort = order_by[0] + if order_by.count > 1 + @order = order_by[1] + end + sort = "#{@sort} #{@order}" + end + # show_attachments [@course] + begin + q = "%#{params[:name].strip}%" + #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank? + if params[:insite] + if q == "%%" + @result = [] + @searched_attach = paginateHelper @result,10 + else + @result = find_public_attache q,sort + @result = visable_attachemnts_insite @result,@org_subfield + @searched_attach = paginateHelper @result,10 + end + else + @result = find_org_subfield_attache q,@org_subfield,sort + @result = visable_attachemnts @result + @searched_attach = paginateHelper @result,10 + @tag_list = attachment_tag_list @result + end + #rescue Exception => e + # #render 'stores' + # redirect_to search_course_files_url + end + end + def find_course_attache keywords,course,sort = "" if sort == "" sort = "created_on DESC" @@ -144,6 +183,19 @@ class FilesController < ApplicationController #resultSet = Attachment.find_by_sql("SELECT `attachments`.* FROM `attachments` LEFT OUTER JOIN `homework_attaches` ON `attachments`.container_type = 'HomeworkAttach' AND `attachments`.container_id = `homework_attaches`.id LEFT OUTER JOIN `homework_for_courses` ON `homework_attaches`.bid_id = `homework_for_courses`.bid_id LEFT OUTER JOIN `homework_for_courses` AS H_C ON `attachments`.container_type = 'Bid' AND `attachments`.container_id = H_C.bid_id WHERE (`homework_for_courses`.course_id = 117 OR H_C.course_id = 117 OR (`attachments`.container_type = 'Course' AND `attachments`.container_id = 117)) AND `attachments`.filename LIKE '%#{keywords}%'").reorder("created_on DESC") end + def find_org_subfield_attache keywords,org_subfield,sort = "" + if sort == "" + sort = "created_on DESC" + end + if keywords != "%%" + resultSet = Attachment.where("attachments.container_type = 'OrgSubfield' And attachments.container_id = '#{org_subfield.id}' AND filename LIKE :like ", like: "%#{keywords}%"). + reorder(sort) + else + resultSet = Attachment.where("attachments.container_type = 'OrgSubfield' And attachments.container_id = '#{org_subfield.id}' "). reorder(sort) + end + #resultSet = Attachment.find_by_sql("SELECT `attachments`.* FROM `attachments` LEFT OUTER JOIN `homework_attaches` ON `attachments`.container_type = 'HomeworkAttach' AND `attachments`.container_id = `homework_attaches`.id LEFT OUTER JOIN `homework_for_courses` ON `homework_attaches`.bid_id = `homework_for_courses`.bid_id LEFT OUTER JOIN `homework_for_courses` AS H_C ON `attachments`.container_type = 'Bid' AND `attachments`.container_id = H_C.bid_id WHERE (`homework_for_courses`.course_id = 117 OR H_C.course_id = 117 OR (`attachments`.container_type = 'Course' AND `attachments`.container_id = 117)) AND `attachments`.filename LIKE '%#{keywords}%'").reorder("created_on DESC") + end + def find_project_attache keywords,project,sort = "" if sort == "" sort = "created_on DESC" @@ -298,10 +350,52 @@ class FilesController < ApplicationController render :layout => 'base_courses' elsif params[:org_subfield_id] + if params[:sort] + params[:sort].split(",").each do |sort_type| + order_by = sort_type.split(":") + + case order_by[0] + when "filename" + attribute = "filename" + when "size" + attribute = "filesize" + when "attach_type" + attribute = "attachtype" + when "content_type" + attribute = "created_on" + when "field_file_dense" + attribute = "is_public" + when "downloads" + attribute = "downloads" + when "created_on" + attribute = "created_on" + when "quotes" + attribute = "quotes" + else + attribute = "created_on" + end + @sort = order_by[0] + @order = order_by[1] + if order_by.count == 1 && attribute + sort += "#{Attachment.table_name}.#{attribute} asc " + if sort_type != params[:sort].split(",").last + sort += "," + end + elsif order_by.count == 2 && order_by[1] + sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} " + if sort_type != params[:sort].split(",").last + sort += "," + end + end + end + else + sort = "#{Attachment.table_name}.created_on desc" + end @container_type = 2 - @organization = Organization.find(params[:organization_id]) @containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)] + @organization = Organization.find(@containers.first.organization_id) show_attachments @containers + @tag_list = attachment_tag_list @all_attachments render :layout => 'base_org' # @subfield = params[:org_subfield_id] end @@ -318,6 +412,12 @@ class FilesController < ApplicationController @can_quote = attachment_candown @file end + def quote_resource_show_org_subfield + @file = Attachment.find(params[:id]) + @org_subfield = OrgSubfield.find(params[:org_subfield_id]) + @can_quote = attachment_candown @file + end + def new @versions = @project.versions.sort @course_tag = @project.project_type @@ -430,14 +530,29 @@ class FilesController < ApplicationController end elsif @org_subfield @addTag=false - # if params[:in_org_subfield_toolbar] - # @in_org_subfield_toolbar = params[:in_org_subfield_toolbar] - # end attachments = Attachment.attach_filesex(@org_subfield, params[:attachments], params[:org_subfield_attachment_type]) - # if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added') - # Mailer.run.attachments_added(attachments[:files]) - # end + if params[:org_subfield_attachment_type] && params[:org_subfield_attachment_type].is_a?(Array) + params[:org_subfield_attachment_type].each do |type| + tag_name = get_tag_name_by_type_number type + if !attachments.empty? && attachments[:files] && tag_name != "" + attachments[:files].each do |attachment| + attachment.tag_list.add(tag_name) + attachment.save + end + end + end + else + if params[:org_subfield_attachment_type] && params[:org_subfield_attachment_type] != "5" + tag_name = get_tag_name_by_type_number params[:org_subfield_attachment_type] + if !attachments.empty? && attachments[:files] && tag_name != "" + attachments[:files].each do |attachment| + attachment.tag_list.add(tag_name) + attachment.save + end + end + end + end # TODO: 临时用 nyan sort_init 'created_on', 'desc' @@ -446,19 +561,18 @@ class FilesController < ApplicationController 'size' => "#{Attachment.table_name}.filesize", 'downloads' => "#{Attachment.table_name}.downloads" - @containers = [OrgSubfield.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@org_subfield.id)] #modify by Long Jun - # @containers += @org_subfield.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort + @containers = [OrgSubfield.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@org_subfield.id)] show_attachments @containers - + @tag_list = attachment_tag_list @all_attachments @attachtype = 0 @contenttype = 0 respond_to do |format| format.js - format.html { - redirect_to org_subfield_files_url(@org_subfield) - } + # format.html { + # redirect_to org_subfield_files_url(@org_subfield) + # } end end end @@ -640,4 +754,34 @@ class FilesController < ApplicationController # format.html end end + + #搜索资源栏目的指定TAG的资源列表 + def search_org_subfield_tag_attachment + @q,@tag_name,@order = params[:q],params[:tag_name] + @is_remote = true + if params[:sort] + order_by = params[:sort].split(":") + @sort = order_by[0] + if order_by.count > 1 + @order = order_by[1] + end + sort = "#{@sort} #{@order}" + end + + q = "%#{@q.strip}%" + @result = find_org_subfield_attache q,@org_subfield,sort + @result = visable_attachemnts @result + @result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} unless @tag_name.blank? + @searched_attach = paginateHelper @result,10 + @tag_list = get_org_subfield_tag_list @org_subfield + + respond_to do |format| + format.js + # format.html + end + end + + def subfield_upload_file + @org_subfield = OrgSubfield.find(params[:org_subfield_id]) + end end diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index efbb4ffab..3332f1207 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -147,8 +147,8 @@ class ForumsController < ApplicationController order = "#{Memo.table_name}.updated_at #{params[:reorder_time]}" @order_str = "reorder_time="+params[:reorder_time] else - order = "last_replies_memos.created_at desc, #{Memo.table_name}.created_at desc" - @order_str = "reorder_complex=desc" + order = "#{Memo.table_name}.updated_at desc" + @order_str = "reorder_time=desc" end @memo = Memo.new(:forum => @forum) @topic_count = @forum.topics.count diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 7cdc838e2..2c1f78de8 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -81,12 +81,15 @@ class IssuesController < ApplicationController @status_id = params[:status_id] @subject = params[:subject] @issue_count = @query.issue_count - @issue_pages = Paginator.new @issue_count, @limit, params['page'] + @issue_pages = Paginator.new @issue_count, @limit, params['page'].to_i + 1 @offset ||= @issue_pages.offset @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], :order => sort_clause, :offset => @offset, :limit => @limit) + if params[:set_filter] + @set_filter = params[:set_filter] + end @issue_count_by_group = @query.issue_count_by_group respond_to do |format| format.js @@ -216,7 +219,7 @@ class IssuesController < ApplicationController @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) saved = false begin - saved = @issue.save_issue_with_child_records(params, @time_entry) + @saved = @issue.save_issue_with_child_records(params, @time_entry) rescue ActiveRecord::StaleObjectError @conflict = true if params[:last_journal_id] @@ -225,7 +228,7 @@ class IssuesController < ApplicationController end end - if saved + if @saved #修改界面增加跟踪者 watcherlist = @issue.watcher_users select_users = [] @@ -254,13 +257,16 @@ class IssuesController < ApplicationController if reply_id > 0 JournalReply.add_reply(@issue.current_journal.id, reply_id, User.current.id) end - flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record? + #flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record? 去掉这个notice,因为现在更新都是ajax操作 respond_to do |format| + format.js format.html { redirect_to issue_url(@issue.id) } format.api { render_api_ok } end else respond_to do |format| + + format.js format.html { render :action => 'edit' } format.api { render_validation_errors(@issue) } end @@ -398,6 +404,9 @@ class IssuesController < ApplicationController user_activity.updated_at = jour.created_on user_activity.save @user_activity_id = params[:user_activity_id] + if params[:issue_id] + @issue_id = params[:issue_id] + end respond_to do |format| format.js end @@ -421,6 +430,43 @@ class IssuesController < ApplicationController end end + #对某个journ回复,显示回复框 + def reply + @issue = Issue.find(params[:id]) + @jour = Journal.find(params[:journal_id]) + @tempContent = "
#{ll(Setting.default_language, :text_user_wrote, @jour.user.realname.blank? ? @jour.user.login: @jour.user.realname)}
#{@jour.notes.html_safe}
".html_safe + respond_to do |format| + format.js + end + end + + #给issue添加journ。回复内容包含 对某个被回复的journ的内容 + def add_reply + if User.current.logged? + jour = Journal.new + jour.user_id = User.current.id + jour.notes = params[:quote]+params[:notes] + @issue = Issue.find params[:id] + jour.journalized = @issue + jour.save + user_activity = UserActivity.where("act_type='Issue' and act_id =#{@issue.id}").first + user_activity.updated_at = jour.created_on + user_activity.save + respond_to do |format| + format.js + end + end + end + + # + def delete_journal + @issue = Issue.find(params[:id]) + Journal.destroy(params[:journal_id]) + respond_to do |format| + format.js + end + end + private def find_project diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 2d2c058d4..a47ddf787 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -159,7 +159,8 @@ class MemosController < ApplicationController @memo.update_column(:content, params[:memo][:content]) && @memo.update_column(:sticky, params[:memo][:sticky]) && @memo.update_column(:lock, params[:memo][:lock]) && - @memo.update_column(:subject,params[:memo][:subject])) + @memo.update_column(:subject,params[:memo][:subject]) && + @memo.update_column(:updated_at,Time.now)) @memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads])) @flag = @memo.save # @memo.root.update_attribute(:updated_at, @memo.updated_at) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index ab2cfa2ba..ccebdccfa 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -75,17 +75,18 @@ class ProjectsController < ApplicationController if !params[:name].nil? condition = "%#{params[:name].strip}%".gsub(" ","") end + limit = 15 project_org_ids = OrgProject.find_by_sql("select distinct organization_id from org_projects where project_id = #{params[:id]}").map(&:organization_id) if project_org_ids.empty? - @orgs_not_in_project = Organization.where("(is_public or creator_id =?) = 1 and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(10) + @orgs_not_in_project = Organization.where("(is_public or creator_id =?) = 1 and name like ?",User.current.id, condition).page((params[:page].to_i || 1)).per(limit) @org_count = Organization.where("is_public = 1 or creator_id =?", User.current.id).where("name like ?", condition).count else project_org_ids = "(" + project_org_ids.join(',') + ")" - @orgs_not_in_project = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(10) + @orgs_not_in_project = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?) and name like ?", User.current.id, condition).page((params[:page].to_i || 1)).per(limit) @org_count = Organization.where("id not in #{project_org_ids} and (is_public = 1 or creator_id =?)", User.current.id).where("name like ?", condition).count end # @project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count - @orgs_page = Paginator.new @org_count, 10,params[:page] + @orgs_page = Paginator.new @org_count, limit,params[:page] @no_roll_hint = params[:hint_flag] #render :json => {:orgs => @orgs_not_in_project, :count => @org_count}.to_json respond_to do |format| diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index cb61177f5..d40bc7c7c 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -227,6 +227,12 @@ class TagsController < ApplicationController @tag_list = get_course_tag_list @course @select_tag_name = params[:select_tag_name] end + + if @obj && @object_flag == '6' && @obj.container.kind_of?(OrgSubfield) + @org_subfield = @obj.container + @tag_list = get_org_subfield_tag_list @org_subfield + @select_tag_name = params[:select_tag_name] + end # end end end @@ -314,6 +320,86 @@ class TagsController < ApplicationController end end + def update_org_subfield_tag_name + @tag_name = params[:tagName] + @rename_tag_name = params[:renameName] + @taggable_id = params[:taggableId] + @taggable_type = numbers_to_object_type(params[:taggableType]) + @rename_tag = (ActsAsTaggableOn::Tag.find_by_name(@rename_tag_name)) #查找重命名后的tag + @tag_id = (ActsAsTaggableOn::Tag.find_by_name(@tag_name)).id #重命名前的tag_id + @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type) unless @taggable_id.blank? + @obj = get_object(@taggable_id,params[:taggableType]) unless @taggable_id.blank? + if @taggable_id.blank? #如果没有传tag_id,那么直接更新tag_name就好了。但是要防止 重命名后的tag存在。 + if params[:org_subfield_id] + org_subfield = OrgSubfield.find params[:org_subfield_id] + if org_subfield + org_subfield.attachments.each do |attachment| + taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,attachment.id,attachment.class) + if taggings + taggings.delete + attachment.tag_list.add(@rename_tag_name.split(",")) + attachment.save + end + end + end + end + else + if(@rename_tag.nil?) #这次命名的是新的tag + + # 是否还有其他记录 引用了 tag_id + @tagging = ActsAsTaggableOn::Tagging.where("tag_id = #{@tag_id}") + # 如果taggings表中记录为 1 ,那么改变@tag_id对应的tag的名字 + if @tagging.count == 1 + @tag = ActsAsTaggableOn::Tag.find_by_id(@tag_id) + @tag.update_attributes({:name=>@rename_tag_name}) + else #如果tagging表中的记录大于1,那么就要新增tag记录 + + unless @obj.nil? + @obj.tag_list.add(@rename_tag_name.split(",")) + @obj.save + end + #删除原来的对应的taggings的记录 + unless @taggings.nil? + @taggings.delete + end + end + else #这是已有的tag + # 更改taggings记录里的tag_id + unless @taggings.nil? + @taggings.update_attributes({:tag_id=>@rename_tag.id}) + end + end + end + + @obj_flag = params[:taggableType] + if @obj && @obj_flag == '6' && @obj.container.kind_of?(OrgSubfield) + @org_subfield = @obj.container + @tag_list = @tag_list = get_org_subfield_tag_list @org_subfield + elsif params[:org_subfield_id] + @org_subfield = OrgSubfield.find(params[:org_subfield_id]) + @tag_list = get_org_subfield_tag_list @org_subfield + + #这里要引用FilesController里的逻辑了。将资源库当前的文件列表刷新一遍。 + @flag = params[:flag] || false + sort = "" + @sort = "" + @order = "" + @is_remote = false + @isproject = false + + sort = "#{Attachment.table_name}.created_on desc" + + @containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)] + + show_attachments @containers + elsif @obj && @obj_flag == '5' + @forum = @obj + end + respond_to do |format| + format.js + end + end + def show_attachments obj @attachments = [] obj.each do |container| @@ -372,6 +458,10 @@ class TagsController < ApplicationController @course = @obj.container @tag_list = @tag_list = get_course_tag_list @course end + if @obj && @obj_flag == '6' && @obj.container.kind_of?(OrgSubfield) + @org_subfield = @obj.container + @tag_list = @tag_list = get_org_subfield_tag_list @org_subfield + end respond_to do |format| format.js format.html diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 02676978f..281b8b7e0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1441,7 +1441,8 @@ class UsersController < ApplicationController def search_user_course @user = User.current if !params[:search].nil? - @course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like '%#{params[:search.to_s]}%'") + search = "%#{params[:search].to_s.strip.downcase}%" + @course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) .select { |course| @user.allowed_to?(:as_teacher,course)} else @course = @user.courses @@ -1460,7 +1461,8 @@ class UsersController < ApplicationController def search_user_project @user = User.current if !params[:search].nil? - @projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like '%#{params[:search.to_s]}%'") + search = "%#{params[:search].to_s.strip.downcase}%" + @projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) else @projects = @user.projects end @@ -1875,46 +1877,46 @@ class UsersController < ApplicationController # 根据资源关键字进行搜索 def resource_search - search = params[:search].to_s.strip.downcase + search = "%#{params[:search].strip.downcase}%" if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') #全部 if User.current.id.to_i == params[:id].to_i user_course_ids = User.current.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(',')}))) and (filename like '%#{search}%') ").order("created_on desc") + " or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))) and (filename like :p) ",:p=>search).order("created_on desc") else user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中 @attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type in" + " ('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon'))"+ " or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) )" + - " and (filename like '%#{search}%') ").order("created_on desc") + " and (filename like :p) ",:p=>search).order("created_on desc") end elsif params[:type] == "2" #课程资源 if User.current.id.to_i == params[:id].to_i user_course_ids = User.current.courses.map { |c| 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") + @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 :p) ",:p=>search).order("created_on desc") else user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中 @attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type = 'Course') "+ "or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) )"+ - " and (filename like '%#{search}%') ").order("created_on desc") + " and (filename like :p) ",:p=>search).order("created_on desc") end elsif params[:type] == "3" #项目资源 if User.current.id.to_i == params[:id].to_i - @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like '%#{search}%')").order("created_on desc") + @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like :p)",:p=>search).order("created_on desc") else - @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' and (filename like '%#{search}%') ").order("created_on desc") + @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' and (filename like :p) ",:p=>search).order("created_on desc") end elsif params[:type] == "4" #附件 if User.current.id.to_i == params[:id].to_i - @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") + @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("created_on desc") else - @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc") + @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("created_on desc") end elsif params[:type] == "5" #用户资源 if User.current.id.to_i == params[:id].to_i - @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like '%#{search}%')").order("created_on desc") + @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like :p)",:p=>search).order("created_on desc") else - @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Principal' and (filename like '%#{search}%')").order("created_on desc") + @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Principal' and (filename like :p)",:p=>search).order("created_on desc") end end @type = params[:type] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5a9563b73..ce4c07c55 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1924,6 +1924,8 @@ module ApplicationHelper elsif attachment.container.is_a?(Course) course = attachment.container candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) + elsif attachment.container.is_a?(OrgSubfield) + candown = true elsif (attachment.container.has_attribute?(:board) || attachment.container.has_attribute?(:board_id)) && attachment.container.board && attachment.container.board.course course = attachment.container.board.course @@ -1934,7 +1936,9 @@ module ApplicationHelper candown = true elsif attachment.container.class.to_s=="StudentWork" candown = true - elsif attachment.container.class.to_s=="BlogComment" + elsif attachment.container.class.to_s=="BlogComment" #博客资源允许下载 + candown = true + elsif attachment.container.class.to_s=="Memo" #论坛资源允许下载 candown = true elsif attachment.container.class.to_s == "User" candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id) @@ -2378,6 +2382,15 @@ module ApplicationHelper tag_list end + def get_org_subfield_tag_list org_subfield + all_attachments = org_subfield.attachments.select{|attachment| attachment.is_public? || + (attachment.container_type == "OrgSubfield" && User.current.member_of_org?(org_subfield.organization))|| + attachment.author_id == User.current.id + } + tag_list = attachment_tag_list all_attachments + tag_list + end + #获取匿评相关连接代码 def homework_anonymous_comment (homework, is_in_course, user_activity_id = -1, course_activity = -1) if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index cf9cbcc32..bd023f6d0 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -67,6 +67,17 @@ module FilesHelper s.html_safe end + #带勾选框的组织资源栏目列表 + def org_subfields_check_box_tags(name,org_subfields,attachment) + s = '' + org_subfields.each do |org_subfield| + if !org_subfield.attachments.include?attachment + s << "
" + end + end + s.html_safe + end + #判断用户是否拥有不包含当前资源的课程,需用户在该课程中角色为教师且该课程属于当前学期或下一学期 def has_course? user,file result = false @@ -141,6 +152,12 @@ module FilesHelper result << attachment end end + elsif obj.is_a?(OrgSubfield) + attachments.each do |attachment| + if attachment.is_public? || (attachment.container_type == "OrgSubfield" && attachment.container_id == obj.id )|| attachment.author_id == User.current.id + result << attachment + end + end end end result diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index ab8b80dcb..aac365a15 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -7,8 +7,10 @@ <% if defined?(container) && container && container.saved_attachments %> <% container.attachments.each_with_index do |attachment, i| %> - <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><%= l(:field_is_public) %>: - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %> + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly', :readonly => 'readonly') %> + <%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %> + + <%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %> <%= if attachment.id.nil? #待补充代码 else @@ -21,24 +23,7 @@
<% end %> - <% container.saved_attachments.each_with_index do |attachment, i| %> - - <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %> - <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %> - <%= l(:field_is_public) %>: - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %> - <%= if attachment.id.nil? - #待补充代码 - else - link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') - end - %> - <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> - <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> - -
- <% end %> <% end %> <% project = project %> diff --git a/app/views/attachments/add_exist_file_to_org_subfield.js.erb b/app/views/attachments/add_exist_file_to_org_subfield.js.erb new file mode 100644 index 000000000..4c4208f76 --- /dev/null +++ b/app/views/attachments/add_exist_file_to_org_subfield.js.erb @@ -0,0 +1,8 @@ +<% if !@save_flag && @save_message %> + $("#error_show").html("<%= @save_message.join(', ') %>"); +<% elsif @message && @message != "" %> + $("#error_show").html("<%= @message.html_safe %>"); +<% else %> + closeModal(); + location.reload(); +<% end %> \ No newline at end of file diff --git a/app/views/courses/search_public_orgs_not_in_course.js.erb b/app/views/courses/search_public_orgs_not_in_course.js.erb index 2669f8a0f..ebd0c58a7 100644 --- a/app/views/courses/search_public_orgs_not_in_course.js.erb +++ b/app/views/courses/search_public_orgs_not_in_course.js.erb @@ -11,7 +11,7 @@ $("#search_orgs_result_list").append('') -<% if @org_count > 10 %> +<% if @org_count > 15 %> $("#paginator").html(' <%= pagination_links_full @orgs_page, @org_count ,:per_page_links => true,:remote =>true,:flag=>true%>'); $("#paginator").css("display", "block"); <% else %> diff --git a/app/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb index a8aa13458..029570047 100644 --- a/app/views/files/_org_subfield_list.html.erb +++ b/app/views/files/_org_subfield_list.html.erb @@ -14,10 +14,9 @@

- - - - +
+ <%= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%> +
@@ -29,6 +28,11 @@ download_named_attachment_path(file.id, file.filename), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <% if User.current.logged? %> + <% if !@org_subfield.attachments.all.include?file %> + <%= link_to("选入栏目",quote_resource_show_org_subfield_org_subfield_file_path(:org_subfield_id => @org_subfield.id, :id => file.id),:class => "f_l re_select c_lorange",:remote => true) %> + <% else %> + <%= link_to("选入组织其他栏目",quote_resource_show_org_subfield_org_subfield_file_path(:org_subfield_id => @org_subfield.id, :id => file.id),:class => "f_l re_select c_lorange",:remote => true) %> + <% end %> <%= file_preview_tag(file, class: 'f_l re_open', style:'text-align: center;') %> <% end %>
@@ -40,11 +44,10 @@

<%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>  |  下载<%= file.downloads %>  |  引用<%= file.quotes.nil? ? 0:file.quotes %>

- - - - - +
+ <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %> + <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %> +
<% end %> diff --git a/app/views/files/_show_quote_resource_org_subfield.html.erb b/app/views/files/_show_quote_resource_org_subfield.html.erb new file mode 100644 index 000000000..ab2eb318d --- /dev/null +++ b/app/views/files/_show_quote_resource_org_subfield.html.erb @@ -0,0 +1,31 @@ +
+
+

将此资源引入组织资源栏目

+ <% if error == '403' %> +
+
您没有权限引用此资源
+
+ <% else %> +
+
+ <%= form_tag attachments_add_exist_file_to_org_subfield_path, + method: :post, + remote: true, + id: "relation_file_form" do %> + <%= hidden_field_tag(:file_id, file.id) %> + <%= content_tag('div', org_subfields_check_box_tags('org_subfields[org_subfield][]',org_subfield.organization.org_subfields.where("field_type='Resource'"),file), :id => 'org_subfields')%> + 引  用取  消 + <% end -%> +
+ <% end %> + + +
+
+ + \ No newline at end of file diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb index ea408c7a6..09f74d3cd 100644 --- a/app/views/files/_subfield_files.html.erb +++ b/app/views/files/_subfield_files.html.erb @@ -15,9 +15,9 @@ { switch(obj) { - case 1: - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>'); - break; +// case 1: +// $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>'); +// break; case 2: $('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 2}) %>'); break; @@ -27,9 +27,9 @@ case 4: $('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 4}) %>'); break; - case 6: - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 6}) %>'); - break; +// case 6: +// $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 6}) %>'); +// break; default: $('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 5}) %>'); } @@ -68,27 +68,27 @@
- <%= form_tag( search_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search f_l",:remote=>true) do %> + <%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search f_l",:remote=>true) do %> <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%> - <%= submit_tag "栏目内搜索", :class => "re_schbtn b_lblue",:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %> + <%= submit_tag "栏目内搜索", :class => "re_schbtn b_lblue",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %> <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <% end %> <%# if is_org_subfield_teacher(User.current,@org_subfield) || (@org_subfield.publish_resource==1 && User.current.member_of_org_subfield?(@org_subfield) ) %>

上传: - 课件 |  + 软件 |  媒体 |  代码 |  - 论文 |  + 其他

<%# end %>
-
+
<%= render :partial => 'org_subfield_list',:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments} %>
diff --git a/app/views/files/_subfield_tags.html.erb b/app/views/files/_subfield_tags.html.erb new file mode 100644 index 000000000..ed7ad660e --- /dev/null +++ b/app/views/files/_subfield_tags.html.erb @@ -0,0 +1,45 @@ +<% if org_subfield %> + + 全部 +<% end %> +<% unless tag_list.nil?%> + <% tag_list.each do |k,v|%> + <% if tag_name && tag_name == k%> + + <%= k%>(<%= v%>) + <% else%> + + <%= k%>(<%= v%>) + <% end%> + <% end%> +<% end%> + + \ No newline at end of file diff --git a/app/views/files/_upload_subfield_file.html.erb b/app/views/files/_upload_subfield_file.html.erb index c3ca72ecd..7137e14e7 100644 --- a/app/views/files/_upload_subfield_file.html.erb +++ b/app/views/files/_upload_subfield_file.html.erb @@ -6,11 +6,19 @@ <%= error_messages_for 'attachment' %> - <%= form_tag(org_subfield_files_path(org_subfield), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> - - - - <%= render :partial => 'files/attachement_list',:locals => {:org_subfield => org_subfield} %> + <%= form_tag(org_subfield_files_path(org_subfield, :in_org => params[:in_org]), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> + <% if params[:in_org] %> +
+ 软件 |  + 媒体 |  + 代码 |  + 其他 +
+ <% else %> + + <% end %> + + <%= render :partial => 'files/attachement_list'%>
<%= l(:button_cancel)%> <%= l(:button_confirm)%> @@ -18,9 +26,7 @@
- <% content_for :header_tags do %> - <%= javascript_include_tag 'attachments' %> - <% end %> +
diff --git a/app/views/files/quote_resource_show_org_subfield.js.erb b/app/views/files/quote_resource_show_org_subfield.js.erb new file mode 100644 index 000000000..fe34e9624 --- /dev/null +++ b/app/views/files/quote_resource_show_org_subfield.js.erb @@ -0,0 +1,11 @@ +<% if @can_quote %> +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => ''}) %>'); +<% else %> +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_org_subfield',:locals => {:org_subfield => @org_subfield,:file => @file,:error => '403'}) %>'); +<% end %> + +showModal('ajax-modal', '513px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before(""); +$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file diff --git a/app/views/files/search_files_in_subfield.js.erb b/app/views/files/search_files_in_subfield.js.erb new file mode 100644 index 000000000..deed2d5d3 --- /dev/null +++ b/app/views/files/search_files_in_subfield.js.erb @@ -0,0 +1,2 @@ +$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list', + :locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>"); \ No newline at end of file diff --git a/app/views/files/search_org_subfield_tag_attachment.js.erb b/app/views/files/search_org_subfield_tag_attachment.js.erb new file mode 100644 index 000000000..deed2d5d3 --- /dev/null +++ b/app/views/files/search_org_subfield_tag_attachment.js.erb @@ -0,0 +1,2 @@ +$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list', + :locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>"); \ No newline at end of file diff --git a/app/views/files/subfield_upload_file.js.erb b/app/views/files/subfield_upload_file.js.erb new file mode 100644 index 000000000..fc3afc0ff --- /dev/null +++ b/app/views/files/subfield_upload_file.js.erb @@ -0,0 +1,6 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>'); +showModal('ajax-modal', '513px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before(""); +$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 2a7a02e57..b0ed5a60c 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -30,9 +30,11 @@ <% end %>
-
综合
+
时间
人气
-
时间
+ +
综合
+
发布新帖
diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index ae2a848e0..97e95d4a9 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -2,5 +2,5 @@ <%#= watcher_link_issue(@issue, User.current) %> <%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'talk_edit fr' if User.current.allowed_to?(:add_issues, @project) %> <%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %> -<%= link_to l(:button_edit), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> -<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> +<%= link_to l(:button_edit), 'javascript:void(0);', :onclick => 'issueEditShow();', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> +<%#= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index 54cb85212..1b6bebb01 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -1,7 +1,6 @@ <%= labelled_fields_for :issue, @issue do |f| %>
-
- <%= l(:label_change_properties) %> +
  • @@ -54,7 +53,7 @@
-
    +
    • <% if @issue.safe_attribute? 'start_date' %> diff --git a/app/views/issues/_attributes_show.html.erb b/app/views/issues/_attributes_show.html.erb index 7b9e2bedf..15160facb 100644 --- a/app/views/issues/_attributes_show.html.erb +++ b/app/views/issues/_attributes_show.html.erb @@ -1,5 +1,5 @@ -
      +
      <%= issue_fields_rows do |rows| %>
      •  状态  : 

        <%= @issue.status.name %>

        diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb new file mode 100644 index 000000000..b175bd417 --- /dev/null +++ b/app/views/issues/_detail.html.erb @@ -0,0 +1,38 @@ +
        +
        + <%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %> +
        +
        +

        <%= @issue.subject %> + <%= get_issue_priority(@issue.priority_id)[1] %>

        +
        +
        + 由<%= @issue.author %>添加于 <%= format_time(@issue.created_on).html_safe %> +
        + + + +<%= render :partial => 'action_menu' %> +
        +<% if @issue.description? || @issue.attachments.any? -%> +
        + <% if @issue.description? %> + <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> + <%= textAreailizable @issue, :description, :attachments => @issue.attachments %> + <% end %> +
        +<% end -%> +<% if @issue.attachments.any? %> +
        + + + <%= link_to_attachment_project @issue, :thumbnails => true %>
        + <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %> +
        +
        +<% end %> + + +<%= render :partial => 'issues/attributes_show' %> +
        +
        \ No newline at end of file diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index b8f362429..2879c9592 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -1,46 +1,29 @@ +
      • @@ -34,7 +37,11 @@
      • <%= item.try(:highlight).try(:description) ? item.highlight.description[0].html_safe : item.description %>
      • -
      • 教师:<%= User.find(item.tea_id).realname %>授课时间:<%= item.time.to_s + item.term%><%= User.find(item.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(item.tea_id).user_extensions.occupation : ''%>
      • +
      • + 教师:<%= User.find(item.tea_id).realname %> + 授课时间:<%= item.time.to_s + item.term%> + 更新时间:<%= format_date(item.updated_at)%> + <%= User.find(item.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(item.tea_id).user_extensions.occupation : ''%>
    • @@ -51,7 +58,9 @@
    • 发布者:<%= User.find(item.author_id).login%>(<%= User.find(item.author_id).realname%>) - 发布时间:<%= format_date(item.created_on)%>
    • + 发布时间:<%= format_date(item.created_on)%> + 下载次数:<%= item.downloads%>次 +
    @@ -67,7 +76,7 @@
  • <%= item.try(:highlight).try(:description) ? item.highlight.description[0].html_safe : item.description%>
  • -
  • 管理人员:<%= item.user_id ? User.find(item.user_id).login : '无' %>创建时间:<%= date_format_local( Project.find(item.id).created_on) %>
  • +
  • 管理人员:<%= item.user_id ? User.find(item.user_id).login : '无' %>更新时间:<%= date_format_local( Project.find(item.id).updated_on) %>
@@ -83,7 +92,7 @@
  • <%= item.try(:highlight).try(:content) ? item.highlight.content[0].html_safe : item.content.html_safe%>
  • -
  • 发帖人:<%= item.author_id ? User.find(item.author_id).login : '无' %>创建时间:<%= format_date( item.created_at) %>
  • +
  • 发帖人:<%= item.author_id ? User.find(item.author_id).login : '无' %>更新时间:<%= format_date( item.updated_at) %>
  • diff --git a/app/views/welcome/_search_attachment_results.html.erb b/app/views/welcome/_search_attachment_results.html.erb index 36c4fcbab..21ba68336 100644 --- a/app/views/welcome/_search_attachment_results.html.erb +++ b/app/views/welcome/_search_attachment_results.html.erb @@ -12,7 +12,9 @@
  • 发布者:<%= User.find(attachment.author_id).login%>(<%= User.find(attachment.author_id).realname%>) - 发布时间:<%= format_date(attachment.created_on)%>
  • + 发布时间:<%= format_date(attachment.created_on)%> + 下载次数:<%= attachment.downloads%>次 +
    diff --git a/app/views/welcome/_search_course_results.html.erb b/app/views/welcome/_search_course_results.html.erb index 89567063d..e51452ada 100644 --- a/app/views/welcome/_search_course_results.html.erb +++ b/app/views/welcome/_search_course_results.html.erb @@ -12,7 +12,11 @@
  • <%= course.try(:highlight).try(:description) ? course.highlight.description[0].html_safe : (course.description.present? ? course.description : '暂时没有该课程描述') %>
  • -
  • 教师:<%= User.find(course.tea_id).realname %>授课时间:<%= course.time.to_s + course.term%><%= User.find(course.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(course.tea_id).user_extensions.occupation : ''%>
  • +
  • + 教师:<%= User.find(course.tea_id).realname %> + 授课时间:<%= course.time.to_s + course.term%> + 更新时间:<%= format_date(course.updated_at)%> + <%= User.find(course.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(course.tea_id).user_extensions.occupation : ''%>
  • diff --git a/app/views/welcome/_search_memo_results.html.erb b/app/views/welcome/_search_memo_results.html.erb index c5fe9cc72..98f9ae7f0 100644 --- a/app/views/welcome/_search_memo_results.html.erb +++ b/app/views/welcome/_search_memo_results.html.erb @@ -12,7 +12,7 @@
  • <%= memo.try(:highlight).try(:content) ? memo.highlight.content[0].html_safe : memo.content.html_safe%>
  • -
  • 发帖人:<%= memo.author_id ? User.find(memo.author_id).login : '无' %>创建时间:<%= format_date( memo.created_at) %>
  • +
  • 发帖人:<%= memo.author_id ? User.find(memo.author_id).login : '无' %>更新时间:<%= format_date( memo.updated_at) %>
  • diff --git a/app/views/welcome/_search_project_results.html.erb b/app/views/welcome/_search_project_results.html.erb index b3ed44654..5775a939d 100644 --- a/app/views/welcome/_search_project_results.html.erb +++ b/app/views/welcome/_search_project_results.html.erb @@ -12,7 +12,7 @@
  • <%= project.try(:highlight).try(:description) ? project.highlight.description[0].html_safe : project.description%>
  • -
  • 管理人员:<%= project.user_id ? User.find(project.user_id).login : '无' %>创建时间:<%= date_format_local( Project.find(project.id).created_on) %>
  • +
  • 管理人员:<%= project.user_id ? User.find(project.user_id).login : '无' %>更新时间:<%= date_format_local( Project.find(project.id).updated_on) %>
  • diff --git a/app/views/welcome/_search_user_results.html.erb b/app/views/welcome/_search_user_results.html.erb index 459d3a27b..d1c8c2393 100644 --- a/app/views/welcome/_search_user_results.html.erb +++ b/app/views/welcome/_search_user_results.html.erb @@ -12,7 +12,9 @@
  • <%= User.find(user.id).user_extensions && User.find(user.id).user_extensions.brief_introduction.present? ? User.find(user.id).user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%>
  • -
  • 加入时间:<%= format_date( User.find(user.id).created_on)%><%= User.find(user.id).user_extensions.occupation.present? ? '单位:'+User.find(user.id).user_extensions.occupation : ''%>
  • +
  • 加入时间:<%= format_date( User.find(user.id).created_on)%> + 最后登陆时间:<%= format_date( User.find(user.id).last_login_on)%> + <%= User.find(user.id).user_extensions.occupation.present? ? '单位:'+User.find(user.id).user_extensions.occupation : ''%>
  • diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 81b20a67e..03424bd5a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1969,9 +1969,11 @@ zh: label_my_score: 我的评分 field_open_anonymous_evaluation: 是否使用匿评 label_course_empty_select: 尚未选择课程! + label_resource_subfield_empty_select: 尚未选择资源栏目! label_project_empty_select: 尚未选择项目! label_course_prompt: 课程: label_project_prompt: 项目: + label_resource_subfield_prompt: 资源栏目: label_contain_resource: 已包含资源: label_quote_resource_failed: ",此资源引用失败! " label_file_lost: 以下无法成功下载,请联系相关人员重新上传: diff --git a/config/routes.rb b/config/routes.rb index 52fa393ad..efce89e62 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -75,12 +75,13 @@ RedmineApp::Application.routes.draw do resources :files, :only => [:index, :new, :create] do collection do match "getattachtype", :via => [:get, :post] - match "search",:via => [:post,:get] + match "search_files_in_subfield",:via => [:post,:get] match "searchone4reload",:via => [:post,:get] - match "search_tag_attachment", :via => [:post,:get] + match "search_org_subfield_tag_attachment", :via => [:post,:get] + match "subfield_upload_file", :via => :post end member do - match "quote_resource_show", :via => [:get] + match "quote_resource_show_org_subfield", :via => [:get] end end end @@ -705,6 +706,9 @@ RedmineApp::Application.routes.draw do member do post 'add_journal' post 'add_journal_in_org' + get 'delete_journal' + get 'reply' + post 'add_reply' end resources :time_entries, :controller => 'timelog' do collection do @@ -806,6 +810,7 @@ RedmineApp::Application.routes.draw do post 'attachments/relationfiles', to: 'attachments#add_exist_file_to_projects', as: 'attach_relations' post 'attachments/courserelationfile', to: 'attachments#add_exist_file_to_course', as: 'course_attach_relation' post 'attachments/courserelationfiles', to: 'attachments#add_exist_file_to_courses', as: 'course_attach_relations' + match 'attachments/add_exist_file_to_org_subfield' get 'attachments/renderTag/:attchmentId', :to => 'attachments#renderTag', :attchmentId => /\d+/ resources :attachments, :only => [:show, :destroy] do collection do @@ -1046,6 +1051,7 @@ RedmineApp::Application.routes.draw do match 'tags/remove_tag_new', :as=>"remove_tag_new" match 'tags/tag_save', :as => "save_tag" match 'tags/update_tag_name',:as => "update_tag_name" + match 'tags/update_org_subfield_tag_name' match 'words/add_brief_introdution' diff --git a/db/schema.rb b/db/schema.rb index 51020f45d..ac785d05e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -544,26 +544,23 @@ ActiveRecord::Schema.define(:version => 20151215112107) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 + create_table "dts", :force => true do |t| + t.string "IPLineCode" t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 + t.string "Num" + t.string "Variable" + t.string "TraceInfo" + t.string "Method" + t.string "File" + t.string "IPLine" + t.string "Review" + t.string "Category" + t.string "Defect" + t.string "PreConditions" + t.string "StartLine" t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "editor_of_documents", :force => true do |t| @@ -912,6 +909,16 @@ ActiveRecord::Schema.define(:version => 20151215112107) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_details_copy", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" @@ -1619,6 +1626,10 @@ ActiveRecord::Schema.define(:version => 20151215112107) do t.string "extra" end + create_table "temp", :id => false, :force => true do |t| + t.integer "id", :default => 0, :null => false + end + create_table "time_entries", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false diff --git a/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb b/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb index e7d3e2ad2..23bd5108b 100644 --- a/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb +++ b/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb @@ -9,3 +9,15 @@ $('#all_attributes').html('<%= escape_javascript(render :partial => 'form') %>') <% else %> $('#log_time').hide(); <% end %> +issue_desc_editor = KindEditor.create('#issue_description', + {"width":"85%", + "resizeType":0, + "no_label":true, + "autoHeightMode":true, + "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\"),$(this.toolbar.div).hide();})", + "afterFocus":"eval(function(){$(this.toolbar.div).show();})", + "afterBlur":"eval(function(){$(this.toolbar.div).hide();})", + "emotionsBasePath":"http://localhost:3000", + "height":300,"allowFileManager":true, + "uploadJson":"/kindeditor/upload", + "fileManagerJson":"/kindeditor/filemanager"}); \ No newline at end of file diff --git a/public/assets/kindeditor/plugins/autoheight/autoheight.js b/public/assets/kindeditor/plugins/autoheight/autoheight.js index 3c25fe49e..b63dc7062 100644 --- a/public/assets/kindeditor/plugins/autoheight/autoheight.js +++ b/public/assets/kindeditor/plugins/autoheight/autoheight.js @@ -29,7 +29,7 @@ KindEditor.plugin('autoheight', function(K) { edit.iframe.height(minHeight); self.resize(null, Math.max( (K.IE ? body.scrollHeight : body.offsetHeight) - + 76, minHeight)); + + 33, minHeight)); } function init() { @@ -42,7 +42,7 @@ KindEditor.plugin('autoheight', function(K) { edit.iframe.height(minHeight); self.resize(null, Math.max( ((K.IE ? body.scrollHeight : body.offsetHeight) > 500 ? 500 : (K.IE ? body.scrollHeight : body.offsetHeight)) //限制初始化太高的情况 - + 76, minHeight)); + + 33, minHeight)); } if (self.isCreated) { diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 50f271a8a..901e302d3 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -590,7 +590,11 @@ function setupAjaxIndicator() { $('#ajax-indicator').hide(); if(MathJax && MathJax.Hub) MathJax.Hub.Queue(['Typeset', MathJax.Hub]); //如果是ajax刷新页面的话,手动执行MathJax的公式显示 + try{ + prettyPrint(); //如果刷新出来的页面如果存在代码行的话,也需要美化 + }catch (e){ + } }); } @@ -965,6 +969,7 @@ function showNormalImage(id) { var element=$("").attr("href",image.attr('src')); image.wrap(element); } + $('#'+id+' a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); //有图片才将链接变为弹出框 } - $('#'+id+' a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); + } diff --git a/public/javascripts/create_kindeditor.js b/public/javascripts/create_kindeditor.js new file mode 100644 index 000000000..3f555ac88 --- /dev/null +++ b/public/javascripts/create_kindeditor.js @@ -0,0 +1,173 @@ +//需求:表情栏可以隐藏显示,高度只要一点高 +function sd_create_editor(params){ + // var minHeight; //最小高度 + var paramsHeight = params.height; //设定的高度 + var id = arguments[1] ? arguments[1] : undefined; + var paramsWidth = params.width == undefined ? "100%" : params.width; + + var editor = params.kindutil.create(params.textarea, { + resizeType : 1,minWidth:"1px",width:"94%", + height:"33px",// == undefined ? "30px":paramsHeight+"px", + minHeight:"33px",// == undefined ? "30px":paramsHeight+"px", + items:['emoticons','fontname', + 'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|', + 'formatblock', 'fontsize', '|','indent', 'outdent', + '|','imagedirectupload'], + afterChange:function(){//按键事件 + + 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)); + }, + afterBlur:function(){ + //params.toolbar_container.hide(); + sd_check_editor_form_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); + if(this.isEmpty()) { + this.edit.html("我要回复"); + } + //params.toolbar_container.hide(); + $('#reply_image_' + id).addClass('imageFuzzy'); + if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html())){ + params.submit_btn.hide(); + params.toolbar_container.hide(); + this.resize("100%", null); + }else if(this.edit.html().trim() != ""){ + params.submit_btn.show(); + params.toolbar_container.show(); + } + + //params.submit_btn.css("display","none"); + }, + afterFocus: function(){ + var edit = this.edit; + var body = edit.doc.body; + if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){ + edit.html(''); + } + params.submit_btn.show(); + params.contentmsg.hide(); + params.toolbar_container.show(); + // params.toolbar_container.show(); + $('#reply_image_' + id).removeClass('imageFuzzy'); + //edit.iframe.width(paramsWidth); + this.resize(paramsWidth, null); + //params.submit_btn.show(); + }, + + afterCreate:function(){ + //params.submit_btn.hide(); + var toolbar = $("div[class='ke-toolbar']",params.div_form); + toolbar.css('display','inline'); + toolbar.css('padding',0); + $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情'); + params.toolbar_container.append(toolbar); + params.toolbar_container.hide(); + //init + var edit = this.edit; + var body = edit.doc.body; + edit.iframe[0].scroll = 'no'; + body.style.overflowY = 'hidden'; + //reset height + paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight; + edit.iframe.height(paramsHeight); + edit.html("我要回复"); + this.resize(null,paramsHeight);// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight) + // params.toolbar_container.hide(); + + } + }).loadPlugin('paste'); + return editor; +} + +function sd_check_editor_form_field(params){ + var result=true; + if(params.content!=undefined){ + if(params.content.isEmpty()){ + result=false; + } + if(params.content.html()!=params.textarea.html() || params.issubmit==true){ + params.textarea.html(params.content.html()); + params.content.sync(); + if(params.content.isEmpty() || /^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(params.textarea.html())){ + params.contentmsg.html('内容不能为空'); + params.contentmsg.css({color:'#ff0000'}); + }else{ + params.contentmsg.html('填写正确'); + params.contentmsg.css({color:'#008000'}); + } + params.contentmsg.show(); + } + } + return result; +} +function sd_create_form(params){ + params.form.submit(function(){ + var flag = false; + if(params.form.attr('data-remote') != undefined ){ + flag = true + } + var is_checked = sd_check_editor_form_field({ + issubmit:true, + content:params.editor, + contentmsg:params.contentmsg, + textarea:params.textarea + }); + if(is_checked){ + if(flag){ + return true; + }else{ + $(this)[0].submit(); + return false; + } + } + return false; + }); +} +function sd_reset_editor_form(params){ + params.form[0].reset(); + params.textarea.empty(); + if(params.editor != undefined){ + params.editor.html(params.textarea.html()); + } + params.contentmsg.hide(); +} +//第二个参数是高度,可以传,可以不传 +function sd_create_editor_from_data(id){ + var height = arguments[1] ? arguments[1] : undefined; + var width = arguments[2] ? arguments[2] : undefined; + KindEditor.ready(function (K) { + $("div[nhname='new_message_" + id + "']").each(function () { + var params = {}; + params.kindutil = K; + params.div_form = $(this); + params.form = $("form", params.div_form); + if (params.form == undefined || params.form.length == 0) { + return; + } + params.textarea = $("textarea[nhname='new_message_textarea_" + id + "']", params.div_form); + params.contentmsg = $("span[nhname='contentmsg_" + id + "']", params.div_form); + params.toolbar_container = $("div[nhname='toolbar_container_" + id + "']", params.div_form); + params.cancel_btn = $("#new_message_cancel_btn_" + id); + params.submit_btn = $("#new_message_submit_btn_" + id); + params.height = height; + params.width = width; + if (params.textarea.data('init') == undefined) { + params.editor = sd_create_editor(params,id); + sd_create_form(params); + params.cancel_btn.click(function () { + sd_reset_editor_form(params); + }); + params.submit_btn.click(function () { + params.form.submit(); + }); + params.textarea.data('init', 1); + $(this).show(); + } + }); + }); + + div_form = $("div[nhname='new_message_" + id + "']"); + $(".ke-edit", div_form).css("height","33px"); + $(".ke-edit-iframe",div_form).css("height","33px"); +} \ No newline at end of file diff --git a/public/javascripts/project.js b/public/javascripts/project.js index f3e6b76ce..a7bf954a0 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -541,4 +541,14 @@ function cancel_relation(orgId,projectId){ }); } }); +} + +function issueEditShow(){ + $("#issue_detail").hide(); + $("#issue_edit").show(); +} + +function issueDetailShow(){ + $("#issue_edit").hide(); + $("#issue_detail").show(); } \ No newline at end of file diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 5a98211ab..005f771a3 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1328,7 +1328,7 @@ a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; c .ul_normal_color li {list-style-position:inside; padding-left:1px; list-style-image:url('../images/news_dot.png')} span.author { font-size: 0.9em; color: #888; } .ReplyToMessageInputContainer {width: 582px;float: left;} - +.ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;} /*全站搜索*/ .blocks {padding:15px; background-color:#ffffff; border:1px solid #dddddd;} #searchBanner {border-bottom:1px solid #d0d0d0;} diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 584f1bafa..44dcc70e3 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -83,4 +83,6 @@ a.linkGrey8:hover {color:#585858;} .re_con{ margin:5px; width:665px;} .re_con_top{color:#494949; } .re_con_top span{ color:#999999; font-weight:bold;} -ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } \ No newline at end of file +ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } + +.popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} \ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index b1367b882..1663df30f 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -161,9 +161,9 @@ a:hover.invi_search_btn{ background:#0da1b2; border:1px solid #0da1b2;} /*问题跟踪*/ .problem_top{ margin:10px 0 ;} -.problem_search_input{ border:1px solid #64bdd9; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:5px;} -a.problem_search_btn{ background:#64bdd9; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #64bdd9; padding-top:2px; cursor:pointer;} -a:hover.problem_search_btn{ background:#3da1c1; border:1px solid #3da1c1;} +.problem_search_input{ border:1px solid #dddddd; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:5px;} +a.problem_search_btn{ background:#269ac9; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #64bdd9; padding-top:2px; cursor:pointer;} +a:hover.problem_search_btn{ background:#269ac9; border:1px solid #3da1c1;} a.problem_new_btn{ margin-left:10px; border:1px solid #ff7143; color:#ff7143; width:60px; height:21px; font-size:12px; text-align:center; padding-top:3px;} a:hover.problem_new_btn{ background:#ff7143; color:#fff;} .problem_p{ color:#535252; margin-top:5px;} @@ -1065,4 +1065,23 @@ a.homepagePostTypeQuiz { padding-left: 23px; } -.loadMore {font-size:14px;width:748px; text-align:center; display:block; border:1px solid #dddddd; background-color:#ffffff; float:right;padding:5px 0; letter-spacing: 1px;} \ No newline at end of file +.loadMore {font-size:14px;width:748px; text-align:center; display:block; border:1px solid #dddddd; background-color:#ffffff; float:right;padding:5px 0; letter-spacing: 1px;} + +img.date-trigger { + display:block; + cursor: pointer; + vertical-align: middle; + float:left; + border:1px solid #dddddd; + padding:1px 2px 2px 2px; + border-left:none; +} +.proInfoBox{ margin-left:60px; border:1px solid #dddddd; height:45px; padding:10px 0; background-color:#f1f1f1;} +.proInfoBox ul li{ height:24px;} +.proInfoP{color:#000000 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } + +a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } +a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} +.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;} +.ReplyToMessageInputContainer {width: 582px;float: left;} +.ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;} \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index fa1767ad7..13362dd19 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -12,7 +12,7 @@ textarea {resize: none;} .pInline {margin:0px; padding:0px; display:inline-block;} /*常用*/ -select,input,textarea{ border:1px solid #269ac9; background:#fff; color:#000; padding-left:5px} +select,input,textarea{ border:1px solid #dddddd; background:#fff; color:#000; padding-left:5px} .sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; margin-bottom:10px; background:#dbdbdb;} .sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;} table{ background:#fff;} @@ -73,6 +73,7 @@ h4{ font-size:14px; color:#3b3b3b;} .ml30{ margin-left:30px;} .ml38{ margin-left:38px;} .ml60{ margin-left:60px;} +.ml160 {margin-left:160px;} .ml80{ margin-left:80px;} .ml90{ margin-left:90px;} .ml100{ margin-left:100px;} @@ -86,6 +87,7 @@ h4{ font-size:14px; color:#3b3b3b;} .mr55{ margin-right:55px;} .mr10{ margin-right:10px;} .mr15 {margin-right:15px;} +.mr18 {margin-right:15px;} .mr20{ margin-right:20px;} .mr25 {margin-right:25px;} .mr30{ margin-right:30px;} @@ -145,7 +147,8 @@ h4{ font-size:14px; color:#3b3b3b;} .w583{ width:583px;} .w350{ width:350px;} .w610{ width:610px;} -.w600{ width:600px !important;} +.w60{ width:600px !important;} +.w606{ width:606px } .h20{height: 20px;} .h22{ height:22px;} .h26{ height:26px;}