From eb8e9f32a34c4ed02e7dfd9adcfc81c2337c5944 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 14 Dec 2015 10:06:19 +0800 Subject: [PATCH 01/76] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E7=A7=81=E6=9C=89=E9=A1=B9=E7=9B=AE=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_show.html.erb | 7 ++++++- app/views/users/_course_homework.html.erb | 4 ++-- app/views/users/_user_homework_detail.html.erb | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index 801c252cb..f92614e10 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -46,7 +46,12 @@ <% if @homework.homework_detail_group.base_on_project == 1 %>
  • 关联项目: - <%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%> + <% if work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %> + <%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%> + <% else %> + <%=work.project.name %> + <% end %> + <%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%> (综合评分:<%=work.project.project_score.score.to_i %>)
  • <% end %> diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index b38a17bea..2096e3c82 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -105,8 +105,8 @@ <% activity.student_work_projects.where("is_leader = 1").each do |pro| %>
    - <% project = Project.find pro.project_id || User.current.member_of?(project) || User.current.admin? %> - <% if project.is_public || project.user_id == User.current.id %> + <% project = Project.find pro.project_id %> + <% if project.is_public || User.current.member_of?(project) || User.current.admin?%> <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:alt =>"项目头像" %> <% else %> <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius") %> diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 57fe57c07..59d7785e1 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -108,8 +108,8 @@ <% homework_common.student_work_projects.where("is_leader = 1").each do |pro| %>
    <% project = Project.find pro.project_id %> - <% if project.is_public == 1 || User.current.member_of?(project) || User.current.admin? %> - <%=link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name) %> + <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> + <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:alt =>"项目头像" %> <% else %> <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius") %> <% end %> From 9b86ec30445a0ad2682ee91361ecbbf2a0019543 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 14 Dec 2015 10:07:55 +0800 Subject: [PATCH 02/76] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/_search_all_results.html.erb | 4 ++-- app/views/welcome/_search_memo_results.html.erb | 2 +- app/views/welcome/_search_project_results.html.erb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/welcome/_search_all_results.html.erb b/app/views/welcome/_search_all_results.html.erb index 34ef9a8eb..7256534e5 100644 --- a/app/views/welcome/_search_all_results.html.erb +++ b/app/views/welcome/_search_all_results.html.erb @@ -67,7 +67,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 +83,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_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) %>
  • From 0602a03e12000d2b4081b33215c0e7d97969f6e1 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 14 Dec 2015 10:26:34 +0800 Subject: [PATCH 03/76] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=A0=8F=E7=9B=AE=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 93 +++++++++++++++++++ app/helpers/files_helper.rb | 6 ++ app/views/files/_subfield_files.html.erb | 2 +- .../files/search_files_in_subfield.js.erb | 2 + .../_org_left_subfield_list.html.erb | 4 +- config/routes.rb | 2 +- db/schema.rb | 4 + 7 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 app/views/files/search_files_in_subfield.js.erb diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 328446fbb..6ed42bd6e 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 = get_course_tag_list @course + 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,6 +350,47 @@ 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)] diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index cf9cbcc32..276786fb7 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -141,6 +141,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/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb index ea408c7a6..b0bc9ea09 100644 --- a/app/views/files/_subfield_files.html.erb +++ b/app/views/files/_subfield_files.html.erb @@ -68,7 +68,7 @@
    - <%= 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",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> 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/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 367c23843..152310bba 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -29,8 +29,8 @@ <%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %> <%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%> <% else %> - <%#= link_to "#{field.name}", org_subfield_files_path(field, :organization_id => organization.id), :class => "homepageMenuText" %> - <%= field.name %> + <%= link_to "#{field.name}", org_subfield_files_path(field, :organization_id => organization.id), :class => "homepageMenuText" %> + <% end %>
    - <% content_for :header_tags do %> - <%= javascript_include_tag 'attachments' %> - <% end %> +
    From b761121f9f2319c2061c902000b7b3fcdabfec76 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 15 Dec 2015 15:00:24 +0800 Subject: [PATCH 22/76] =?UTF-8?q?"=E6=8C=87=E6=B4=BE=E7=BB=99"=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E6=9B=B4=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 304 ++++++++++++------------ 1 file changed, 152 insertions(+), 152 deletions(-) diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index c5b777286..88b880ada 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -1,152 +1,152 @@ -
    -
    -
    - <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> -
    -
    -
    - <% if activity.try(:author).try(:realname) == ' ' %> - <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% end %> TO - <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> -
    -
    - <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %> - - <%= get_issue_priority(activity.priority_id)[1] %> - -
    -
    -
    指派给   - <% unless activity.assigned_to_id.nil? %> - <% if activity.try(:assigned_to).try(:realname) == ' ' %> - <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> - <% end %> - <% end %> -
    -
    - 时间: - <%=format_time(activity.created_on) %> -
    -
    -
    -
    - <% if activity.description? %> - <%= textAreailizable activity, :description, :attachments => activity.attachments %> - <% end %> -
    -
    -
    - - -
    -
    - <% if activity.attachments.any? %> - <% activity.attachments.each do |attachment| %> -
    - - - <%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%> - - <% if attachment.is_text? %> - <%= link_to image_tag('magnifier.png'), - :controller => 'attachments', - :action => 'show', - :id => attachment, - :class => 'fl', - :filename => attachment.filename %> - <% end %> - - ( - <%= number_to_human_size attachment.filesize %>) - - - <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>, - <%= format_time(attachment.created_on) %> - -
    - <% end %> - <% end %> -
    -
    -
    -
    - <% count = activity.journals.count %> -
    -
    -
    -
    回复(<%= count %>)
    -
    <%#= format_date(activity.updated_on) %>
    - <% if count > 3 %> - - <% end %> -
    - - <% replies_all_i = 0 %> - <% if count > 0 %> -
    -
      - <% activity.journals.reorder("created_on desc").each do |reply| %> - - <% replies_all_i=replies_all_i + 1 %> -
    • -
      - <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %> -
      -
      -
      - <% if reply.try(:user).try(:realname) == ' ' %> - <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%= format_time(reply.created_on) %> -
      -
      - <% if reply.details.any? %> - <% details_to_strings(reply.details).each do |string| %> -

      <%= string %>

      - <% end %> - <% end %> -

      <%= reply.notes.html_safe %>

      -
      -
      -
      -
    • - <% end %> -
    -
    - <% end %> - -
    -
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
    -
    -
    - <%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%> - - -
    - -
    -

    - <% end%> -
    -
    -
    -
    -
    - -
    -
    +
    +
    +
    + <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> +
    +
    +
    + <% if activity.try(:author).try(:realname) == ' ' %> + <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% end %> TO + <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> +
    +
    + <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %> + + <%= get_issue_priority(activity.priority_id)[1] %> + +
    +
    +
    指派给   + <% unless activity.assigned_to_id.nil? %> + <% if activity.try(:assigned_to).try(:realname) == ' ' %> + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% end %> + <% end %> +
    +
    + 时间: + <%=format_time(activity.created_on) %> +
    +
    +
    +
    + <% if activity.description? %> + <%= textAreailizable activity, :description, :attachments => activity.attachments %> + <% end %> +
    +
    +
    + + +
    +
    + <% if activity.attachments.any? %> + <% activity.attachments.each do |attachment| %> +
    + + + <%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%> + + <% if attachment.is_text? %> + <%= link_to image_tag('magnifier.png'), + :controller => 'attachments', + :action => 'show', + :id => attachment, + :class => 'fl', + :filename => attachment.filename %> + <% end %> + + ( + <%= number_to_human_size attachment.filesize %>) + + + <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>, + <%= format_time(attachment.created_on) %> + +
    + <% end %> + <% end %> +
    +
    +
    +
    + <% count = activity.journals.count %> +
    +
    +
    +
    回复(<%= count %>)
    +
    <%#= format_date(activity.updated_on) %>
    + <% if count > 3 %> + + <% end %> +
    + + <% replies_all_i = 0 %> + <% if count > 0 %> +
    +
      + <% activity.journals.reorder("created_on desc").each do |reply| %> + + <% replies_all_i=replies_all_i + 1 %> +
    • +
      + <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %> +
      +
      +
      + <% if reply.try(:user).try(:realname) == ' ' %> + <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> + <% end %> + <%= format_time(reply.created_on) %> +
      +
      + <% if reply.details.any? %> + <% details_to_strings(reply.details).each do |string| %> +

      <%= string %>

      + <% end %> + <% end %> +

      <%= reply.notes.html_safe %>

      +
      +
      +
      +
    • + <% end %> +
    +
    + <% end %> + +
    +
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
    +
    +
    + <%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%> + + +
    + +
    +

    + <% end%> +
    +
    +
    +
    +
    + +
    +
    From 0deffdba33ab34bc3d1f3bb3a7b8135c503fa9a9 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 15 Dec 2015 15:21:52 +0800 Subject: [PATCH 23/76] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E6=B5=8B=E9=AA=8C?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=AD=94=E9=A2=98=E6=97=B6=E5=8F=AF=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=BF=9D=E5=AD=98=E4=B9=9F=E5=8F=AF=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_controller.rb | 10 ++++---- app/views/exercise/_commit_alert.html.erb | 9 +++++--- app/views/exercise/_exercise_student.html.erb | 23 ++----------------- app/views/exercise/commit_exercise.js.erb | 1 - public/stylesheets/polls.css | 2 +- 5 files changed, 13 insertions(+), 32 deletions(-) diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 286330b4c..17efa6f89 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -522,12 +522,9 @@ class ExerciseController < ApplicationController # @score = 100 if @uncomplete_question.count < 1 # 查看是否有已提交记录 - eu = get_exercise_user(@exercise.id, User.current.id) - eu.user_id = User.current.id - eu.exercise_id = @exercise.id - eu.score = @score - if eu.save - #redirect_to poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course') + cur_exercise_user.score = @score + if cur_exercise_user.save + #redirect_to poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course') @status = 0 #提交成功 else @status = 2 #未知错误 @@ -535,6 +532,7 @@ class ExerciseController < ApplicationController else @status = 1 #有未做得必答题 end + @save = params[:save].to_i if params[:save] respond_to do |format| format.js end diff --git a/app/views/exercise/_commit_alert.html.erb b/app/views/exercise/_commit_alert.html.erb index e9c3ebf57..bed7b6d82 100644 --- a/app/views/exercise/_commit_alert.html.erb +++ b/app/views/exercise/_commit_alert.html.erb @@ -1,12 +1,15 @@
    - <% if status == 0 && exercise.time != -1%> + <% if @save == 1 %> +

    保存成功,测验日期截止前您还可以继续答题。

    + <%= link_to "确定", exercise_index_path(:course_id => @course.id),:class => 'commit'%> + <% elsif status == 0 && exercise.time != -1%>

    提交成功!您的分数是:<%=@score %>分。

    <%= link_to "确定", exercise_path(),:class => 'commit'%> <% elsif status == 0 && Time.parse(format_time(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") > Time.now.strftime("%Y-%m-%d %H:%M:%S") %> -

    提交成功!

    +

    提交成功,测验日期截止前您还可以修改,祝您考高分。

    <%= link_to "确定", exercise_index_path(:course_id => @course.id),:class => 'commit'%> <% elsif status == 1 && Time.parse(format_time(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") > Time.now.strftime("%Y-%m-%d %H:%M:%S")%> -

    保存成功!

    +

    提交成功,您还有未完成的题目,测验日期截止前您还可以继续答题,祝您考高分。

    <%= link_to "确定",exercise_index_path(:course_id => @course.id),:class => 'commit'%> <% elsif status == 1 && Time.parse(format_time(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") <= Time.now.strftime("%Y-%m-%d %H:%M:%S")%>

    时间已到!

    diff --git a/app/views/exercise/_exercise_student.html.erb b/app/views/exercise/_exercise_student.html.erb index 8a7c8bd9d..8a1f3dbd6 100644 --- a/app/views/exercise/_exercise_student.html.erb +++ b/app/views/exercise/_exercise_student.html.erb @@ -3,10 +3,6 @@ $("#RSide").removeAttr("id"); $("#homework_page_right").css("min-height",$("#LSide").height()-30); $("#Container").css("width","1000px"); - <%uncomplete_question =get_uncomplete_question(exercise, User.current) %>; - <% if (uncomplete_question.count < 1) %> - $("#exercise_submit_btn").html("提交"); - <% end %> var end_time = <%=exercise.end_time.to_i%>; getTime(end_time); /*start_time = new Date(); @@ -104,11 +100,6 @@ { obj.checked = false; } - if(dataObj.complete == 1) { - $("#exercise_submit_btn").html("提交"); - } else { - $("#exercise_submit_btn").html("保存"); - } } }); } @@ -163,11 +154,6 @@ { obj.checked = false; } - if(dataObj.complete == 1) { - $("#exercise_submit_btn").html("提交"); - } else { - $("#exercise_submit_btn").html("保存"); - } } }); } @@ -210,11 +196,6 @@ success: function (data) { var dataObj = eval(data); obj.value = dataObj.text; - if(dataObj.complete == 1) { - $("#exercise_submit_btn").html("提交"); - } else { - $("#exercise_submit_btn").html("保存"); - } } }); @@ -228,8 +209,8 @@ <% end %>
    - <%= link_to "保存",commit_exercise_exercise_path(exercise),:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:80px;",:format => 'js',:remote=>true %> - <%= link_to "提交",commit_exercise_exercise_path(exercise),:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:80px;",:format => 'js',:remote=>true %> + <%= link_to "保存",commit_exercise_exercise_path(exercise,:save => 1),:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:format => 'js',:remote=>true %> + <%= link_to "提交",commit_exercise_exercise_path(exercise), :data => {:confirm => "您确定要提交吗?"},:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:20px;",:format => 'js',:remote=>true %>
    diff --git a/app/views/exercise/commit_exercise.js.erb b/app/views/exercise/commit_exercise.js.erb index 5ede8a951..ac8c242d1 100644 --- a/app/views/exercise/commit_exercise.js.erb +++ b/app/views/exercise/commit_exercise.js.erb @@ -1,6 +1,5 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status,:exercise =>@exercise}) %>'); showModal('ajax-modal', '270px'); -$('#ajax-modal').css('height','110px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index cfc3b1b4a..bcace8cf2 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -145,7 +145,7 @@ a:hover.btn_pu{ background:#3cb761;} /*问卷提交时弹出框*/ .alert_box{width:250px;height:180px;position:fixed !important;z-index:100;left:60%;top:65%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} -.commit{height: 28px;display: block;width: 80px;color: #fff !important;background: #15bccf;text-align: center;padding-top: 4px;margin-left: 60px;margin-top: 4px;margin-right: 10px;} +.commit{font-size: 1.2em;height: 28px;display: block;width: 80px;color: #fff !important;background: #15bccf;text-align: center;padding-top: 4px;margin-left: 70px;margin-top: 4px;margin-right: 10px;} /******确定弹框***********/ .poll_alert_form{width:140px;height:180px;position:fixed;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;} .polls_alert_btn_box{width: 100%;margin: 0 auto;padding-left: 45px;} From 0215e5e38c6a10d21ce7f83c07a2e2e7b98b672a Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 15 Dec 2015 15:37:57 +0800 Subject: [PATCH 24/76] =?UTF-8?q?=E8=8B=A5=E6=B5=8B=E9=AA=8C=E5=B7=B2?= =?UTF-8?q?=E6=88=AA=E6=AD=A2=E4=B8=94=E5=AD=A6=E7=94=9F=E5=B7=B2=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=88=99=E5=9C=A8=E6=B5=8B=E9=AA=8C=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=90=8E=E9=9D=A2=E6=98=BE=E7=A4=BA=E2=80=9C=E5=B7=B2=E7=AD=94?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_controller.rb | 2 +- app/views/exercise/_exercise.html.erb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 17efa6f89..0eeffa588 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -27,7 +27,7 @@ class ExerciseController < ApplicationController if @is_teacher || User.current.admin? exercises = @course.exercises.order("created_at asc") else - exercises = @course.exercises.where("exercise_status <> 1 ").order("created_at asc") + exercises = @course.exercises.where("exercise_status <> 1").order("created_at asc") end @exercises = paginateHelper exercises,20 #分页 respond_to do |format| diff --git a/app/views/exercise/_exercise.html.erb b/app/views/exercise/_exercise.html.erb index 30f986d92..19bc520d4 100644 --- a/app/views/exercise/_exercise.html.erb +++ b/app/views/exercise/_exercise.html.erb @@ -56,7 +56,10 @@ <%#else%> - <%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%> + <%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%> + <% if exercise.end_time <= Time.now && has_commit_exercise?(exercise.id, User.current.id) %> +
  • 已答
  • + <% end %> <%#end%> <% end%>
  • 截止时间:<%= format_time(exercise.end_time.to_s)%>
  • From d6c2b95858f030fe1573da9a2aae5b8fb93a1f7c Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 15 Dec 2015 16:02:10 +0800 Subject: [PATCH 25/76] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=B5=8B=E9=AA=8C?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=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 --- app/controllers/exercise_controller.rb | 16 ++++++++-------- app/views/exercise/_student_exercise.html.erb | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 0eeffa588..75751e4f7 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -60,17 +60,17 @@ class ExerciseController < ApplicationController else @can_edit_excercise = !has_commit_exercise?(@exercise.id,User.current.id)&& exercise_end end - @exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first - if @exercise_user.nil? - eu = ExerciseUser.create(:user_id => User.current.id, :exercise_id => @exercise.id, :start_at => Time.now, :status => false) + unless @is_teacher @exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first + if @exercise_user.nil? + eu = ExerciseUser.create(:user_id => User.current.id, :exercise_id => @exercise.id, :start_at => Time.now, :status => false) + @exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first + end + score = calculate_student_score(@exercise, User.current) + @exercise_user.update_attributes(:score => score) end # @percent = get_percent(@exercise,User.current) - exercise_questions = @exercise.exercise_questions - @exercise_questions = paginateHelper exercise_questions,5 #分页 - score = calculate_student_score(@exercise, User.current) - #eu = get_exercise_user(@exercise.id, User.current.id) - @exercise_user.update_attributes(:score => score) + @exercise_questions = @exercise.exercise_questions respond_to do |format| format.html {render :layout => 'base_courses'} end diff --git a/app/views/exercise/_student_exercise.html.erb b/app/views/exercise/_student_exercise.html.erb index 9c9916e60..9b07e0626 100644 --- a/app/views/exercise/_student_exercise.html.erb +++ b/app/views/exercise/_student_exercise.html.erb @@ -38,9 +38,9 @@ $("#show_student_result_div").on('click',show_result); <% else %> $("#show_student_result_div").attr("title","截止日期未到,暂不能查看学生答题结果"); - $("#student_name_id").attr("title","截止日期未到,暂不能查看学生答题结果"); - $("#student_id_id").attr("title","截止日期未到,暂不能查看学生答题结果"); - $("#student_class_id").attr("title","截止日期未到,暂不能查看学生答题结果"); + $("#student_name_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); + $("#student_id_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); + $("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); <% end %> }); function show_result() { @@ -56,13 +56,13 @@
    • -
    • +
    • <%=exercise.user.show_name %>
    • -
    • +
    • <%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
    • -
    • +
    • --
    From 086cfa38676d04e568e8192e484218aca4884fdb Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 15 Dec 2015 16:51:21 +0800 Subject: [PATCH 26/76] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_student_exercise.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/exercise/_student_exercise.html.erb b/app/views/exercise/_student_exercise.html.erb index 9b07e0626..6555cfc61 100644 --- a/app/views/exercise/_student_exercise.html.erb +++ b/app/views/exercise/_student_exercise.html.erb @@ -35,9 +35,9 @@ }); $(function(){ <% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %> - $("#show_student_result_div").on('click',show_result); + $("#show_student_result_div_<%= exercise.id%>").on('click',show_result); <% else %> - $("#show_student_result_div").attr("title","截止日期未到,暂不能查看学生答题结果"); + $("#show_student_result_div_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); $("#student_name_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); $("#student_id_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); $("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); @@ -53,7 +53,7 @@
  • <%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40"),user_activities_path(exercise.user)) %>
  • -
    +
    • From af157a9c63350ffd25865266f681bb9af778dfc4 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 15 Dec 2015 17:30:24 +0800 Subject: [PATCH 27/76] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E5=A2=9E=E5=8A=A0=E6=A0=87=E7=AD=BE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 56 ++++++++++++++++--- app/controllers/tags_controller.rb | 6 ++ app/helpers/application_helper.rb | 9 +++ app/views/files/_org_subfield_list.html.erb | 6 +- app/views/files/_subfield_files.html.erb | 16 +++--- app/views/files/_subfield_tags.html.erb | 43 ++++++++++++++ .../files/_upload_subfield_file.html.erb | 24 ++++---- .../search_org_subfield_tag_attachment.js.erb | 2 + app/views/tags/remove_tag_new.js.erb | 6 +- config/routes.rb | 2 +- 10 files changed, 137 insertions(+), 33 deletions(-) create mode 100644 app/views/files/_subfield_tags.html.erb create mode 100644 app/views/files/search_org_subfield_tag_attachment.js.erb diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 8597ad3b7..51dabebb4 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -395,6 +395,7 @@ class FilesController < ApplicationController @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 @@ -523,14 +524,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' @@ -542,7 +558,7 @@ class FilesController < ApplicationController @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 @@ -733,6 +749,32 @@ class FilesController < ApplicationController 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 diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index cb61177f5..82adc1fff 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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8f4679c67..9a622316a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2376,6 +2376,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/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb index e11e020c2..750aed9ae 100644 --- a/app/views/files/_org_subfield_list.html.erb +++ b/app/views/files/_org_subfield_list.html.erb @@ -14,9 +14,9 @@

  • - - - +
    + <%= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%> +
    diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb index 2a552dc43..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}) %>'); } @@ -77,11 +77,11 @@

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

    <%# end %> diff --git a/app/views/files/_subfield_tags.html.erb b/app/views/files/_subfield_tags.html.erb new file mode 100644 index 000000000..1a2c896fc --- /dev/null +++ b/app/views/files/_subfield_tags.html.erb @@ -0,0 +1,43 @@ +<% if org_subfield && tag_list && tag_list.empty? == false%> + + 全部 +<% 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 567309f9c..7137e14e7 100644 --- a/app/views/files/_upload_subfield_file.html.erb +++ b/app/views/files/_upload_subfield_file.html.erb @@ -7,19 +7,17 @@ <%= 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)%> 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/tags/remove_tag_new.js.erb b/app/views/tags/remove_tag_new.js.erb index 9a43dd9b4..879155aa7 100644 --- a/app/views/tags/remove_tag_new.js.erb +++ b/app/views/tags/remove_tag_new.js.erb @@ -3,8 +3,12 @@ $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag,:select_tag_name => @select_tag_name}) %>'); +<% if @org_subfield %> + $("#files_tag").html("<%= escape_javascript(render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name})%>"); +<% else %> + $("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course,:tag_name => @select_tag_name}) %>"); +<% end %> -$("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course,:tag_name => @select_tag_name}) %>"); <% end %> <% if @object_flag == "10"%> $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); diff --git a/config/routes.rb b/config/routes.rb index 05507d024..28a3fec70 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -77,7 +77,7 @@ RedmineApp::Application.routes.draw do match "getattachtype", :via => [:get, :post] 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 From 45726576cf839c53eefa33da570c6c6b163f753f Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 15 Dec 2015 17:31:27 +0800 Subject: [PATCH 28/76] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=B5=8B=E9=AA=8C?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_student_exercise.html.erb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/exercise/_student_exercise.html.erb b/app/views/exercise/_student_exercise.html.erb index 6555cfc61..bbbe9026d 100644 --- a/app/views/exercise/_student_exercise.html.erb +++ b/app/views/exercise/_student_exercise.html.erb @@ -35,7 +35,9 @@ }); $(function(){ <% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %> - $("#show_student_result_div_<%= exercise.id%>").on('click',show_result); + $("#show_student_result_div_<%= exercise.id%>").on('click',function() { + window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user_id) %>'; + }); <% else %> $("#show_student_result_div_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); $("#student_name_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); @@ -43,9 +45,9 @@ $("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果"); <% end %> }); - function show_result() { - window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>'; - } + /*function show_result(id) { + window.location.href = '<%#=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>'; + }*/
    • From 44ce4fe592f34529729ed505edcf2439c0768da7 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 15 Dec 2015 17:34:08 +0800 Subject: [PATCH 29/76] =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=95=99=E8=A8=80=E4=B8=8D=E4=BC=9A=E9=87=8D=E5=A4=8D=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_courses_jours.html.erb | 100 +++++++++++----------- 1 file changed, 48 insertions(+), 52 deletions(-) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 7b6b44c69..ce775da4d 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -1,22 +1,18 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> -<% end %> - - +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor" %> @@ -24,11 +20,11 @@

      <%= l(:label_leave_message) %>

      <% if !User.current.logged?%> -
      - <%= l(:label_user_login_tips) %> - <%= link_to l(:label_user_login_new), signin_path %> -
      -
      +
      + <%= l(:label_user_login_tips) %> + <%= link_to l(:label_user_login_new), signin_path %> +
      +
      <% else %>
      <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_course_message'}, :html=>{:id => "course_feedback_new"},:method => "post") do |f|%> @@ -59,37 +55,37 @@ $("#submit_feedback_course").one('click',function() { $("#course_feedback_new").submit(); }); - KindEditor.ready(function(K){ - $("a[nhname='reply_btn']").live('click',function(){ - var params = {}; - params.kindutil = K; - params.container = $(this).parent('div').parent('div'); - params.div_form = $(">.respond-form",params.container); - params.form = $("form",params.div_form); - params.textarea = $("textarea[name='user_notes']",params.div_form); - params.contentmsg = $("p[nhname='contentmsg']",params.div_form); - params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); - params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form); - params.height = 55; - if(params.textarea.data('init') == undefined){ - params.editor = init_editor(params); - init_form(params); - params.cancel_btn.click(function(){ - nh_reset_form(params); - }); - } - params.cancel_btn.click(); - toggleAndSettingWordsVal(params.div_form, params.textarea); - setTimeout(function(){ - if(!params.div_form.is(':hidden')){ - params.textarea.show(); - params.textarea.focus(); - params.textarea.hide(); - } - },300); - params.textarea.data('init',1); - }); + KindEditor.ready(function(K){ + $("a[nhname='reply_btn']").live('click',function(){ + var params = {}; + params.kindutil = K; + params.container = $(this).parent('div').parent('div'); + params.div_form = $(">.respond-form",params.container); + params.form = $("form",params.div_form); + params.textarea = $("textarea[name='user_notes']",params.div_form); + params.contentmsg = $("p[nhname='contentmsg']",params.div_form); + params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); + params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form); + params.height = 55; + if(params.textarea.data('init') == undefined){ + params.editor = init_editor(params); + init_form(params); + params.cancel_btn.click(function(){ + nh_reset_form(params); + }); + } + params.cancel_btn.click(); + toggleAndSettingWordsVal(params.div_form, params.textarea); + setTimeout(function(){ + if(!params.div_form.is(':hidden')){ + params.textarea.show(); + params.textarea.focus(); + params.textarea.hide(); + } + },300); + params.textarea.data('init',1); + }); + }); }); - }); From dc4532145487e903367e0bbddf0ea1eedea89c7b Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 15 Dec 2015 17:34:40 +0800 Subject: [PATCH 30/76] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=9B=9E=E5=A4=8D=E4=BB=A3=E7=A0=81=E8=A2=AB?= =?UTF-8?q?=E8=A6=86=E7=9B=96=EF=BC=8C=E6=81=A2=E5=A4=8D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/show.html.erb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index dfe27cde3..7a64e4514 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -1,8 +1,4 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> -<%= javascript_include_tag 'blog' %> -<% end %> - +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %> + <% replies_all_i=replies_all_i + 1 %> +
    • +
      + <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %> +
      +
      +
      + <% if reply.try(:user).try(:realname) == ' ' %> + <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %> + <% end %> + <%= format_time(reply.created_on) %> +
      +
      + <% if reply.details.any? %> + <% details_to_strings(reply.details).each do |string| %> +

      <%= string %>

      + <% end %> + <% end %> +

      <%= reply.notes.html_safe %>

      +
      +
      +
      +
    • + <% end %> +
    \ No newline at end of file diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index 0b1c02b88..5a3fa90ca 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -1,3 +1,8 @@ -$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>"); - -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); \ No newline at end of file +<% if @issue_id%> + $("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>"); + $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)') + issues_reply_editor.html('') +<%else%> + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>"); + init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); +<%end %> \ No newline at end of file diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 80d3aaac1..dc8e2b84a 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,106 +1,55 @@ <%= content_for(:header_tags) do %> -<%= import_ke(enable_at: true) %> + <%= import_ke(enable_at: true) %> <% end %> - -
    -

    <%= l(:label_issue_edit) %>

    + +
    +
    +
    问题跟踪
    -<% html_title "#{@issue.tracker.name} #{@issue.source_from}'#'#{@issue.project_index}: #{@issue.subject}" %> -
    -
    - <%= link_to "#{@issue.project.name}"+">", project_issues_path(@issue.project) %> - <%= "#" + @issue.id.to_s %> -
    -
    -
    - <%= 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 %> -
    - - '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 %> +
    +
    +
    +
    + <%= render :partial => 'issues/detail'%> +
    + - <% end -%> - -
    - - - <%= link_to_attachment_project @issue, :thumbnails => true %>
    - <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %> -
    -
    - - - <%= render :partial => 'attributes_show' %> - - - <%# 该应用是对issue主题内容的引用,对应:to => 'journals#new %> - - -
    -
    - - -
    - - - <% if @issue.editable? %> -
    - <%= render :partial => 'edit' %>
    -

    - <%#--引用时不能修改,剥离出引用内容--%> - - <%= l(:button_submit) %> - - <% end %> - <%#= submit_tag l(:button_submit) %> - <%#= preview_link preview_edit_issue_path(:project_id => @project, :id => @issue), 'issue-form' ,'preview',{:class => "blue_btn fr mr10"}%> -
    -<% if @changesets.present? %> -
    -

    <%= l(:label_associated_revisions) %>

    - <%= render :partial => 'changesets', :locals => {:changesets => @changesets} %> -
    -<% end %> - -
    -<% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> - <%= f.link_to 'PDF' %> -<% end %> + +
    +
    +
    +
    +
    回复(<%= @issue.journals.count %>)
    +
    +
    -<% content_for :sidebar do %> - <%= render :partial => 'issues/sidebar' %> -
    - <% if User.current.allowed_to?(:add_issue_watchers, @project) || - (@issue.watchers.present? && User.current.allowed_to?(:view_issue_watchers, @project)) %> -
    - <%= render :partial => 'watchers/watchers', :locals => {:watched => @issue} %> +
    + <%= render :partial => 'issue_replies',:locals => {:issue=>@issue,:replies_all_i=>0} %>
    - <% end %> -<% end %> -<% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject}") %> -<% end %> -<%= context_menu issues_context_menu_path %> +
    + <%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f|%> +
    + <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %> +
    + +
    + <%= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%> +
    +
    + 发送 +
    + <% end %> +
    +
    + \ No newline at end of file diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb new file mode 100644 index 000000000..504d50a65 --- /dev/null +++ b/app/views/issues/update.js.erb @@ -0,0 +1,5 @@ +$("#issue_detail").html('<%= escape_javascript(render :partial => 'issues/detail') %>') +$("#issue_detail").show(); +$("#issue_edit").hide(); +$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>"); +$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)') \ No newline at end of file diff --git a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb index 08f4da0ad..14eba3bee 100644 --- a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb +++ b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb @@ -1,6 +1,8 @@ module RailsKindeditor module Helper - EVAL_STR = %Q|eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin("autoheight")})| + EVAL_STR = %Q|eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin("autoheight"),$(this.toolbar.div).hide();})| + EVAL_STR_AFTER_FOCUS = %Q|eval(function(){$(this.toolbar.div).show();})| + EVAL_STR_AFTER_BLUR = %Q|eval(function(){$(this.toolbar.div).hide();})| def kindeditor_tag(name, content = nil, options = {}) id = sanitize_to_id(name) @@ -11,6 +13,8 @@ module RailsKindeditor output << javascript_tag(js_replace(id, options.merge(window_onload: 'true', :autoHeightMode=>true, afterCreate: EVAL_STR, + afterFocus:EVAL_STR_AFTER_FOCUS, + afterBlur:EVAL_STR_AFTER_BLUR, emotionsBasePath: 'http://' + Setting.host_name ))) end @@ -24,6 +28,8 @@ module RailsKindeditor output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true', :autoHeightMode=>true, afterCreate: EVAL_STR, + afterFocus:EVAL_STR_AFTER_FOCUS, + afterBlur:EVAL_STR_AFTER_BLUR, emotionsBasePath: 'http://' + Setting.host_name ))) end diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index bf9cb26d8..3096d2326 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -3932,7 +3932,9 @@ _extend(KToolbar, KWidget, { pdiv = $("#define",container); }else if(!$("#full",container).is(':hidden')){ pdiv = $("#full",container); - } + }else if($("#full",container).is(':hidden') && $("#define",container).is(':hidden')){ //都隐藏的情况下 + pdiv = $("#define", container); + } return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent()); }, select : function(name) { @@ -4729,15 +4731,21 @@ function _bindTabEvent() { } function _bindFocusEvent() { var self = this; - K(self.edit.textarea[0], self.edit.win).focus(function(e) { - if (self.afterFocus) { - self.afterFocus.call(self, e); - } - }).blur(function(e) { - if (self.afterBlur) { - self.afterBlur.call(self, e); - } - }); + K(self.edit.textarea[0], self.edit.win).focus(function(e) { + if(typeof self.afterFocus == 'string'){ + self.afterFocus = eval(self.afterFocus); + } + if ( typeof self.afterFocus == 'function') { + self.afterFocus.call(self, e); + } + }).blur(function(e) { + if(typeof self.afterBlur == 'string'){ + self.afterBlur = eval(self.afterBlur); + } + if ( typeof self.afterBlur == 'function') { + self.afterBlur.call(self, e); + } + }); } function _removeBookmarkTag(html) { return _trim(html.replace(/]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig, '')); 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/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/project.css b/public/stylesheets/project.css index b1367b882..aa3297128 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1065,4 +1065,17 @@ 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; } \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index fa1767ad7..6c8b71785 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;} From 699d0e22dd0fd978831a7f6f60e305cdd32bdd6d Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 15 Dec 2015 19:05:19 +0800 Subject: [PATCH 34/76] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=9A=84=E6=B5=8B=E9=AA=8C=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20151215105425_delete_exercise_user.rb | 9 +++++++++ db/schema.rb | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20151215105425_delete_exercise_user.rb diff --git a/db/migrate/20151215105425_delete_exercise_user.rb b/db/migrate/20151215105425_delete_exercise_user.rb new file mode 100644 index 000000000..781337454 --- /dev/null +++ b/db/migrate/20151215105425_delete_exercise_user.rb @@ -0,0 +1,9 @@ +class DeleteExerciseUser < ActiveRecord::Migration + def up + eus=ExerciseUser.where("score is null and status=?",0) + eus.delete_all + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 17e613acb..9926f2876 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151209085942) do +ActiveRecord::Schema.define(:version => 20151215105425) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1161,7 +1161,6 @@ ActiveRecord::Schema.define(:version => 20151209085942) do t.datetime "updated_at", :null => false t.boolean "locked", :default => false t.integer "sticky", :default => 0 - t.integer "org_subfield_id" end create_table "org_member_roles", :force => true do |t| @@ -1188,7 +1187,6 @@ ActiveRecord::Schema.define(:version => 20151209085942) do t.string "name" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "field_type" end create_table "organizations", :force => true do |t| From 481b7b96eb0783a97d6a3cb6b51463b86ab212d2 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 15 Dec 2015 20:15:10 +0800 Subject: [PATCH 35/76] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E7=89=88=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_controller.rb | 8 ++++---- app/views/exercise/_exercise_teacher.html.erb | 4 ++-- db/schema.rb | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 73da3b9c4..3ed5886e7 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -359,7 +359,7 @@ class ExerciseController < ApplicationController if @exercise.end_time <= Time.now @course.student.each do |student| if ExerciseUser.where("user_id = ? && exercise_id = ?",student.student_id,@exercise.id).empty? - ExerciseUser.create(:user_id => student.student_id, :exercise_id => @exercise.id, :start_at => @exercise.end_time, :status => false,:score=>0) + ExerciseUser.create(:user_id => student.student_id, :exercise_id => @exercise.id, :start_at => @exercise.end_time, :status => true,:score=>0) end s_score = calculate_student_score(@exercise, student.student) @@ -577,15 +577,15 @@ class ExerciseController < ApplicationController standard_answer = get_user_standard_answer(question, user) unless answer.empty? # 问答题有多个答案 - if question.question_type == 3 + if question.question_type == 3 && !standard_answer.empty? if standard_answer.include?(answer.first.answer_text) score1 = score1+ question.question_score unless question.question_score.nil? end - elsif question.question_type == 1 + elsif question.question_type == 1 && !standard_answer.nil? if answer.first.exercise_choice.choice_position == standard_answer.exercise_choice_id score2 = score2 + question.question_score unless question.question_score.nil? end - else + elsif question.question_type == 2 && !standard_answer.nil? arr = get_mulscore(question, user) if arr.to_i == standard_answer.exercise_choice_id score3 = score3 + question.question_score unless question.question_score.nil? diff --git a/app/views/exercise/_exercise_teacher.html.erb b/app/views/exercise/_exercise_teacher.html.erb index 24687d28b..586c033a1 100644 --- a/app/views/exercise/_exercise_teacher.html.erb +++ b/app/views/exercise/_exercise_teacher.html.erb @@ -32,7 +32,7 @@
    第<%= list_index+1%>题:<%= exercise_question.question_title %>  (<%= exercise_question.question_score %>分)
    - 标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %> + 标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first %>
    @@ -64,7 +64,7 @@
    第<%= list_index+1%>题:<%= exercise_question.question_title %>  (<%= exercise_question.question_score %>分)
    - 标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %> + 标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first%>
    diff --git a/db/schema.rb b/db/schema.rb index 9926f2876..51020f45d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151215105425) do +ActiveRecord::Schema.define(:version => 20151215112107) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1161,6 +1161,7 @@ ActiveRecord::Schema.define(:version => 20151215105425) do t.datetime "updated_at", :null => false t.boolean "locked", :default => false t.integer "sticky", :default => 0 + t.integer "org_subfield_id" end create_table "org_member_roles", :force => true do |t| @@ -1187,6 +1188,7 @@ ActiveRecord::Schema.define(:version => 20151215105425) do t.string "name" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.string "field_type" end create_table "organizations", :force => true do |t| From 097d0653bac1bf98313ed2f788e0993012b5fd26 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 15 Dec 2015 20:33:29 +0800 Subject: [PATCH 36/76] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E7=BB=99?= =?UTF-8?q?=E6=9C=AA=E7=AD=94=E9=A2=98=E7=9A=84=E5=AD=A6=E7=94=9F0?= =?UTF-8?q?=E5=88=86=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 3ed5886e7..8fa90ea46 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -356,6 +356,7 @@ class ExerciseController < ApplicationController end def student_exercise_list +=begin if @exercise.end_time <= Time.now @course.student.each do |student| if ExerciseUser.where("user_id = ? && exercise_id = ?",student.student_id,@exercise.id).empty? @@ -367,6 +368,7 @@ class ExerciseController < ApplicationController exercise_user.update_attributes(:score => s_score) end end +=end @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? @all_exercises = @course.exercises.where("exercise_status > 1").order("created_at desc") @exercise_count = @exercise.exercise_users.where('score is not NULL').count From 8d1003770a17919a3c02aa2c778ec3b6945e7235 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 15 Dec 2015 23:01:54 +0800 Subject: [PATCH 37/76] =?UTF-8?q?=E5=9C=A8=E6=9C=AC=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=BF=AE=E6=94=B9=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8C=E7=94=B1=E4=BA=8Eedit=E9=A1=B5=E9=9D=A2=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=9B=B4=E6=96=B0=EF=BC=8C=E5=AF=BC=E8=87=B4issue?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A7=A6=E5=8F=91=E4=B9=90=E8=A7=82=E9=94=81?= =?UTF-8?q?=E3=80=82lock=5Fversion=E6=AF=94=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=AD=98=E5=9C=A8=E7=9A=84lock=5Fversion?= =?UTF-8?q?=E6=9B=B4=E4=BD=8E=EF=BC=8C=E6=89=80=E4=BB=A5=E5=9B=9E=E6=BB=9A?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/update.js.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb index 504d50a65..7dba2aa5d 100644 --- a/app/views/issues/update.js.erb +++ b/app/views/issues/update.js.erb @@ -1,4 +1,5 @@ $("#issue_detail").html('<%= escape_javascript(render :partial => 'issues/detail') %>') +$("#issue_edit").html('<%= escape_javascript(render :partial => 'issues/edit') %>') $("#issue_detail").show(); $("#issue_edit").hide(); $("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>"); From 704954583b9f7a1af3223c25ca979bca5bd046f6 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 16 Dec 2015 09:15:54 +0800 Subject: [PATCH 38/76] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AE?= =?UTF-8?q?=E6=96=B0=E5=A2=9ETag=E5=90=8E=EF=BC=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E7=9A=84tag=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 4 ++++ app/views/files/_subfield_tags.html.erb | 2 +- app/views/tags/tag_save.js.erb | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 82adc1fff..511fafdba 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -378,6 +378,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/views/files/_subfield_tags.html.erb b/app/views/files/_subfield_tags.html.erb index 1a2c896fc..b037fcaf4 100644 --- a/app/views/files/_subfield_tags.html.erb +++ b/app/views/files/_subfield_tags.html.erb @@ -1,4 +1,4 @@ -<% if org_subfield && tag_list && tag_list.empty? == false%> +<% if org_subfield %> -<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list', :locals => {:obj => @obj,:object_flag => @obj_flag,:select_tag_name => @select_tag_name}) %>'); $("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course,:tag_name => @select_tag_name}) %>"); - <%else%> + <%elsif @project%> $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").replaceWith('<%= escape_javascript(render :partial => 'tags/tag_new', :locals => {:obj => @obj, :object_flag => "6"}) %>'); + <% else %> + $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); + $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").replaceWith('<%= escape_javascript(render :partial => 'tags/tag_new', :locals => {:obj => @obj, :object_flag => "6"}) %>'); + $("#files_tag").html("<%= escape_javascript(render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name})%>"); //render :partial => 'tags/course_attachment_tag_name', //:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) <%end%> From 8d7a84285b9d970847d5ceeebb5e5ccf4dbcc894 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 16 Dec 2015 09:28:55 +0800 Subject: [PATCH 39/76] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AE?= =?UTF-8?q?=E5=9C=A8=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9B=B8=E5=BA=94=E7=9A=84tag=E6=95=B0?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 51dabebb4..0cd7d77c2 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -162,7 +162,7 @@ class FilesController < ApplicationController @result = find_org_subfield_attache q,@org_subfield,sort @result = visable_attachemnts @result @searched_attach = paginateHelper @result,10 - #@tag_list = get_course_tag_list @course + @tag_list = attachment_tag_list @result end #rescue Exception => e # #render 'stores' From 47a9be132ac4b9ff28e4638110e029244bcd6aed Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 16 Dec 2015 09:31:11 +0800 Subject: [PATCH 40/76] =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=92=8C=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form.html.erb | 23 ++++------------------- app/views/issues/_detail.html.erb | 4 +++- app/views/issues/_edit.html.erb | 2 ++ app/views/issues/show.html.erb | 6 +----- app/views/issues/update.js.erb | 20 +++++++++++++++++--- 5 files changed, 27 insertions(+), 28 deletions(-) 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/issues/_detail.html.erb b/app/views/issues/_detail.html.erb index b085ce32f..b175bd417 100644 --- a/app/views/issues/_detail.html.erb +++ b/app/views/issues/_detail.html.erb @@ -1,3 +1,4 @@ +
    <%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %>
    @@ -33,4 +34,5 @@ <%= render :partial => 'issues/attributes_show' %> -
    \ No newline at end of file +
    +
    \ No newline at end of file diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index 87430e5d6..b1127a3d3 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -1,3 +1,4 @@ + \ No newline at end of file diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index dc8e2b84a..4c56a0f05 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -15,12 +15,8 @@
    -
    <%= render :partial => 'issues/detail'%> -
    - + <%= render :partial => 'issues/edit'%>
    diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb index 7dba2aa5d..d5f213455 100644 --- a/app/views/issues/update.js.erb +++ b/app/views/issues/update.js.erb @@ -1,6 +1,20 @@ -$("#issue_detail").html('<%= escape_javascript(render :partial => 'issues/detail') %>') -$("#issue_edit").html('<%= escape_javascript(render :partial => 'issues/edit') %>') +$("#issue_detail").replaceWith('<%= escape_javascript(render :partial => 'issues/detail') %>') +$("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>') $("#issue_detail").show(); $("#issue_edit").hide(); $("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>"); -$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)') \ No newline at end of file +$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)') +//edit里的编辑器貌似显示不出来,所以手动js生成。 +issue_desc_editor = KindEditor.create('#issue_description', + {"width":"87%", + "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"}); + From 06e5784436cb6a4481972d43b9ac64a988c15c28 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 16 Dec 2015 10:00:10 +0800 Subject: [PATCH 41/76] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E6=A6=9C=E4=B8=A4=E4=B8=AA=E7=94=A8=E6=88=B7=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84but?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journals_for_message.rb | 2 +- ...1215070238_delete_validate_course_contributor.rb | 13 +++++++++++++ db/schema.rb | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20151215070238_delete_validate_course_contributor.rb diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index ec6390408..96853d1c7 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -267,7 +267,7 @@ class JournalsForMessage < ActiveRecord::Base # 课程成员得分(英雄榜) def act_as_student_score - unless self.user.allowed_to?(:as_teacher, self.jour) + if !self.user.allowed_to?(:as_teacher, self.jour) course_member_score(self.jour_id, self.user_id, "JournalForMessage") end end diff --git a/db/migrate/20151215070238_delete_validate_course_contributor.rb b/db/migrate/20151215070238_delete_validate_course_contributor.rb new file mode 100644 index 000000000..704ca893d --- /dev/null +++ b/db/migrate/20151215070238_delete_validate_course_contributor.rb @@ -0,0 +1,13 @@ +class DeleteValidateCourseContributor < ActiveRecord::Migration + def up + course_contributors = CourseContributorScore.where("course_id>? and created_at 20151209085942) do +ActiveRecord::Schema.define(:version => 20151215070238) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From ac8aa9e0a68990e66f07351085df25742d9ea101 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 16 Dec 2015 10:03:51 +0800 Subject: [PATCH 42/76] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=95=99=E8=A8=80=E5=92=8C=E8=AF=BE=E7=A8=8B=E7=95=99=E8=A8=80?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journals_for_message.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 96853d1c7..396133c7a 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -267,7 +267,7 @@ class JournalsForMessage < ActiveRecord::Base # 课程成员得分(英雄榜) def act_as_student_score - if !self.user.allowed_to?(:as_teacher, self.jour) + if !self.user.allowed_to?(:as_teacher, self.jour) && self.jour_type == "Course" course_member_score(self.jour_id, self.user_id, "JournalForMessage") end end From 02a9f08fe606a2b5d4b6a8b53af7f3711430fb27 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 16 Dec 2015 10:19:48 +0800 Subject: [PATCH 43/76] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E9=95=BF=E5=BA=A6?= =?UTF-8?q?=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 2 +- app/views/issues/_form.html.erb | 4 +-- app/views/issues/new.html.erb | 52 ++++++++++++++++------------ app/views/issues/update.js.erb | 2 +- public/stylesheets/public.css | 3 +- 5 files changed, 36 insertions(+), 27 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 9bb602178..1eb39fb32 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -254,7 +254,7 @@ 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) } diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 886ac805a..b96b700d5 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -28,7 +28,7 @@
  • <% if @issue.safe_attribute? 'subject' %> - <%= f.text_field :subject, :class => "w576", :maxlength => 255, :style => "font-size:small", :no_label => true %> + <%= f.text_field :subject, :class => "w606", :maxlength => 255, :style => "font-size:small", :no_label => true %> <%= javascript_tag do %> observeAutocompleteField('issue_subject', @@ -49,7 +49,7 @@ <%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %> <%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> <%#= content_tag 'span', :id => "issue_description_and_toolbar" do %> - <%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'87%', :resizeType => 0, :no_label => true %> + <%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'85%', :resizeType => 0, :no_label => true %> <%# end %> <%#= wikitoolbar_for 'issue_description' %> <% end %> diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb index 9c6ad647c..0e068929d 100644 --- a/app/views/issues/new.html.erb +++ b/app/views/issues/new.html.erb @@ -1,27 +1,35 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <% end %> + +
    +
    +
    新建问题
    +
    +
    + <%= call_hook(:view_issues_new_top, {:issue => @issue}) %> + <%= labelled_form_for @issue, :url => project_issues_path(@project), + :html => {:id => 'issue-form', :multipart => true} do |f| %> + <%= error_messages_for 'issue' %> + <%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %> +
    + <%= render :partial => 'issues/form', :locals => {:f => f} %> +
    + +
    + <%= l(:button_create) %> + + <%#= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %> + <% end %> +
    - -
    -

    <%= l(:label_issue_new) %>

    -
    -<%= call_hook(:view_issues_new_top, {:issue => @issue}) %> -<%= labelled_form_for @issue, :url => project_issues_path(@project), - :html => {:id => 'issue-form', :multipart => true} do |f| %> - <%= error_messages_for 'issue' %> - <%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %> -
    - <%= render :partial => 'issues/form', :locals => {:f => f} %> + <% content_for :header_tags do %> + <%= robot_exclusion_tag %> + <% end %>
    - - - <%= l(:button_create) %> - - <%#= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %> -<% end %> -
    - -<% content_for :header_tags do %> - <%= robot_exclusion_tag %> -<% end %> +
    \ No newline at end of file diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb index d5f213455..8ff6e5245 100644 --- a/app/views/issues/update.js.erb +++ b/app/views/issues/update.js.erb @@ -6,7 +6,7 @@ $("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => $(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)') //edit里的编辑器貌似显示不出来,所以手动js生成。 issue_desc_editor = KindEditor.create('#issue_description', - {"width":"87%", + {"width":"85%", "resizeType":0, "no_label":true, "autoHeightMode":true, diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 6c8b71785..003cf90df 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -146,7 +146,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;} From bfde278340fa21daffcea250234c7e22f0246ea9 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 16 Dec 2015 11:02:52 +0800 Subject: [PATCH 44/76] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 25d0d6a32..77c839f8d 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -41,7 +41,7 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} .pingBoxTit{ float:left; width:625px; margin-left:10px;} .pingText{border:1px solid #CCCCCC; margin:5px; padding:5px; width:610px; height:20px; } .pingBackTit{ float:left; width:573px; margin-left:10px; } -.hworkUl{ height:30px; border-bottom:1px solid #eaeaea; line-height:30px; vertical-align:middle; background-color: #f6f6f6;} +.hworkUl{ height:30px;width:720px; border-bottom:1px solid #eaeaea; line-height:30px; vertical-align:middle; background-color: #f6f6f6;} .hworkH30 {height:30px !important; line-height:30px !important;} .hworkListRow {height:65px; border-bottom:1px dashed #eaeaea; line-height:65px; vertical-align:middle; position: relative;} .hworkListRow:hover {background-color:#f6f6f7;} @@ -1229,4 +1229,4 @@ div.disable_link {background-color: #c1c1c1 !important;} /*新课程资源库*/ .reCon{ margin:5px; width:710px;} -.reTop{width:710px; height:40px; background:#eaeaea; padding:5px;} +.reTop{width:710px; height:40px; background:#eaeaea; padding:5px;} From 977100e92e6f09815794224ea321cf0c56948410 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 16 Dec 2015 11:17:06 +0800 Subject: [PATCH 45/76] =?UTF-8?q?=E5=8F=8C=E5=87=BB=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E6=A0=87=E7=AD=BE=E5=8F=AF=E7=BC=96=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E7=BC=96=E8=BE=91=E6=A0=87=E7=AD=BE=E5=90=8E=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 80 +++++++++++++++++++ app/views/files/_subfield_tags.html.erb | 6 +- app/views/files/index.html.erb | 59 ++++++++++++++ .../tags/update_org_subfield_tag_name.js.erb | 11 +++ config/routes.rb | 1 + 5 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 app/views/tags/update_org_subfield_tag_name.js.erb diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 511fafdba..d40bc7c7c 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -320,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| diff --git a/app/views/files/_subfield_tags.html.erb b/app/views/files/_subfield_tags.html.erb index b037fcaf4..ed7ad660e 100644 --- a/app/views/files/_subfield_tags.html.erb +++ b/app/views/files/_subfield_tags.html.erb @@ -12,13 +12,15 @@ <% else%> <%= k%>(<%= v%>) <% end%> <% end%> <% end%> diff --git a/app/views/tags/update_org_subfield_tag_name.js.erb b/app/views/tags/update_org_subfield_tag_name.js.erb new file mode 100644 index 000000000..4fabc1afd --- /dev/null +++ b/app/views/tags/update_org_subfield_tag_name.js.erb @@ -0,0 +1,11 @@ +<% if @obj %> + $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); + $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list', + :locals => {:obj => @obj,:object_flag => @obj_flag}) %>'); + $("#tags_name_<%=@obj.id%>").val(""); + $("#add_tag_<%=@obj.id%>").hide(); + $("#files_tag").html("<%= escape_javascript(render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @select_tag_name}) %>"); +<% else %> + $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'files/org_subfield_list', + :locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments}) %>"); +<% end %> diff --git a/config/routes.rb b/config/routes.rb index 28a3fec70..6dce046de 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1047,6 +1047,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' From 5cf88a287b3e343a793adb74adfa126ac5cfa8d7 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 16 Dec 2015 11:37:59 +0800 Subject: [PATCH 46/76] =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=AD=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_group_attr.html.erb | 2 +- db/schema.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb index aa8166a04..652cb723a 100644 --- a/app/views/users/_user_group_attr.html.erb +++ b/app/views/users/_user_group_attr.html.erb @@ -11,7 +11,7 @@

    提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计。

    diff --git a/db/schema.rb b/db/schema.rb index 5f53dd5cf..51020f45d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20151215070238) do +ActiveRecord::Schema.define(:version => 20151215112107) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From 2aa241bffa6d49e5922a52f8445e3c8d07e10783 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 16 Dec 2015 11:50:30 +0800 Subject: [PATCH 47/76] issue --- app/views/issues/_list.html.erb | 69 ++++---- app/views/issues/index.html.erb | 283 +++++++++++++++++--------------- public/stylesheets/project.css | 6 +- public/stylesheets/public.css | 1 + 4 files changed, 195 insertions(+), 164 deletions(-) diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 6fc1898d0..327cc2c75 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -1,35 +1,44 @@ <% issue_list(issues) do |issue, level| -%> - <% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %> - <% reset_cycle %> - <% previous_group = group %> - <% end %> - -
    - <% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %> - <% unless issue.author.nil? || issue.author.name == "Anonymous" %> - -
    - <%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %> - <%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>): -
    - <%=link_to "#{column_content[4]}#{get_issue_priority(column_content[3])[1]}".html_safe, issue_path(issue.id), :class => "problem_tit_a break_word",:target => "_blank" %> -
    -
    -

    - <% unless issue.assigned_to_id.nil? %> - <%= l(:field_assigned_to) %> - <%=link_to issue.assigned_to(@user), user_path(issue.assigned_to(@user)), :class => "problem_name c_orange f1" %> - <% end %> - <%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %> -

    -
    - <%=link_to "#{issue.journals.all.count}".html_safe, issue_path(issue.id), :class => "pro_mes_w" %> + + <%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %> + <% end %>
      <%= pagination_links_full issue_pages, issue_count, :per_page_links => false, :remote => true, :flag => true %>
    \ No newline at end of file diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 29c038226..df7f9dddc 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,10 +1,28 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true,init_activity: true) %> +<% end %> + -
    -

    <%= l(:label_issue_tracking) %>

    -
    -
    - <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> - <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> - <%= hidden_field_tag 'set_filter', '1' %> - - <%= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %> -

    <%= l(:label_issues_sum) %>:<%= @project.issues.visible.all.count %> - <%= l(:lable_issues_undo) %>:<%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> -

    +
    +
    +
    <%= l(:label_issue_tracking) %>
    +
    +
    + <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> + <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> + <%= hidden_field_tag 'set_filter', '1' %> + + <%#= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %> +

    <%= l(:label_issues_sum) %>:<%= @project.issues.visible.all.count %> + <%= l(:lable_issues_undo) %>:<%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> +

    + +
    +
    + + <%= select( :issue, :user_id, principals_options_for_isuue_list(@project), + { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 + }, + {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"w90 mr18"} + ) + %> + <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), + { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 + }, + {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w90 mr18"} + ) + %> + <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), + { :include_blank => false,:selected=>@status_id ? @status_id : 0 + }, + {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"w90 mr18"} + ) + %> + <%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]), + { :include_blank => false,:selected=>@author_id ? @author_id : 0 + }, + {:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"w90 mr18"} + ) + %> +
    +
    +
     
    +
    + + <%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%> + <%= calendar_for('issue_create_date_start_show') %> +
    +
     - 
    +
    + + <%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%> + <%= calendar_for('issue_create_date_end_show') %> +
    +
    +
    + <% end %>
    -
    - - <%= select( :issue, :user_id, principals_options_for_isuue_list(@project), - { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 - }, - {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"w90"} - ) - %> - <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), - { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 - }, - {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w90"} - ) - %> - <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), - { :include_blank => false,:selected=>@status_id ? @status_id : 0 - }, - {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"w90"} - ) - %> - <%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]), - { :include_blank => false,:selected=>@author_id ? @author_id : 0 - }, - {:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"w90"} - ) - %> -
    -
    -
     
    -
    - - <%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%> - <%= calendar_for('issue_create_date_start_show') %> -
    -
     - 
    -
    - - <%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%> - <%= calendar_for('issue_create_date_end_show') %> -
    -
    -
    <% end %> +
    -
    - <% end %> -
    -
    - <% if !@query.new_record? && @query.editable_by?(User.current) %> - <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> - <%= delete_link query_path(@query) %> - <% end %> -
    - -<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> -
    -
    - -<%= error_messages_for 'query' %> - -<% if @query.valid? %> - <% if @issues.empty? %> -

    - <%= l(:label_no_data) %> -

    - <% else %> -
    - <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count} %> -
    - - - <% end %> - -
    - <% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %> - <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %> - <%= f.link_to 'PDF', :url => params %> +
    + <% if !@query.new_record? && @query.editable_by?(User.current) %> + <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> + <%= delete_link query_path(@query) %> <% end %>
    - \ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index aa3297128..c0afe45d5 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;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 003cf90df..13362dd19 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -87,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;} From 0fef18312dc0f19246fcc38936219826283c9fc8 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 16 Dec 2015 15:36:01 +0800 Subject: [PATCH 48/76] =?UTF-8?q?=E9=BC=A0=E6=A0=87=E7=BB=8F=E8=BF=87?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AETAG=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=8F=98=E6=88=90=E6=89=8B=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_tag_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb index 14b6a0597..de8c0a4d2 100644 --- a/app/views/tags/_tag_list.html.erb +++ b/app/views/tags/_tag_list.html.erb @@ -2,7 +2,7 @@ <% if @tags.size > 0 %> <% @tags.each do |tag| %> - <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> + <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> <%= tag %> <% case object_flag %> From dc0f004021426fafd8b5c8864f8fe4289269abaf Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 16 Dec 2015 15:47:30 +0800 Subject: [PATCH 49/76] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=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 --- app/views/users/_course_homework.html.erb | 27 ++++++++++++++----- .../users/_user_homework_detail.html.erb | 26 +++++++++++++----- public/stylesheets/courses.css | 1 + public/stylesheets/new_user.css | 2 ++ 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index a3aa5d5b1..fe02d9882 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -104,14 +104,29 @@ 已关联项目:
    <% activity.student_work_projects.where("is_leader = 1").each do |pro| %> -
    - <% project = Project.find pro.project_id %> - <% if project.is_public || User.current.member_of?(project) || User.current.admin?%> - <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:alt =>"项目头像" %> + <% project = Project.find pro.project_id %> + +
    + <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> + <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s,:alt =>"项目头像" %> <% else %> - <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius") %> + <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s,:alt =>"项目头像") %> <% end %> -

    <%=project.project_score.score.to_i %>

    +
    + 项目名称:<%=project.name %>
    + 创建者:<%=(User.find project.user_id).show_name %>
    + <% time=project.updated_on %> + <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> + 更新时间:<%=time_from_now time %> +
    <% end %>
    diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 4217cf1a9..536a9deb6 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -102,18 +102,32 @@ <% if homework_common.homework_type == 3 && !homework_common.student_work_projects.empty? && homework_common.homework_detail_group.base_on_project == 1 %>
    - 已关联项目:
    <% homework_common.student_work_projects.where("is_leader = 1").each do |pro| %> -
    - <% project = Project.find pro.project_id %> + <% project = Project.find pro.project_id %> + +
    <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> - <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:alt =>"项目头像" %> + <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s,:alt =>"项目头像" %> <% else %> - <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius") %> + <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s,:alt =>"项目头像") %> <% end %> -

    <%=project.project_score.score.to_i %>

    +
    + 项目名称:<%=project.name %>
    + 创建者:<%=(User.find project.user_id).show_name %>
    + <% time=project.updated_on %> + <% time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> + 更新时间:<%=time_from_now time %> +
    <% end %>
    diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 77c839f8d..6a6c3a7e7 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1209,6 +1209,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;} .proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;} .hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;} .mr150 {margin-right:150px;} +.relatePInfo {position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} /*上传资源弹窗*/ .resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 0ed4df627..5a98211ab 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1381,3 +1381,5 @@ a:hover.blueCir{ background:#3598db; color:#fff;} .proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;} .hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;} .mr150 {margin-right:150px;} +.relatePInfo {position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} + From b13ae8f599378215f66a71273fa2f7f4cb23a6d9 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 16 Dec 2015 15:55:40 +0800 Subject: [PATCH 50/76] issue --- app/controllers/issues_controller.rb | 2 +- app/views/issues/_list.html.erb | 15 ++++++++++++--- app/views/issues/index.html.erb | 16 ++++++++-------- app/views/issues/index.js.erb | 5 ++--- public/javascripts/application.js | 4 ++++ 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 1eb39fb32..48bf3b568 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -81,7 +81,7 @@ 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, diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 327cc2c75..c071d57d8 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -39,6 +39,15 @@ <%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %> <% end %> -
      - <%= pagination_links_full issue_pages, issue_count, :per_page_links => false, :remote => true, :flag => true %> -
    \ No newline at end of file + <% if issues.count == 10%> +
    展开更多<%=link_to "", project_issues_path(:project_id => project.id,:page => issue_pages.page),:id => "more_issues_link",:remote => "true",:class => "none" %>
    + <%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> + <% end%> + + + + \ No newline at end of file diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index df7f9dddc..7c358aaed 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -144,19 +144,19 @@

    <% else %>
    - <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count} %> + <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} %>
    <% end %> -
    - <% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %> - <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %> - <%= f.link_to 'PDF', :url => params %> - <% end %> -
    + + + + + + +
  • - <%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%> + <%= student_work.student_score.nil? ? "未参与" : format("%.1f",student_work.student_score)%> <% unless student_work.student_score.nil?%> (<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>) @@ -84,7 +84,7 @@ 缺评扣分  <%= student_work.absence_penalty%> 分, 最终成绩为 -  <%= format("%.1f",score)%> 分。 +  <%= format("%.1f",score<0 ? 0 : score)%> 分。
  • <% end%> From a0035a4c1ed46e94ab34255b743323e6ea73341f Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 16 Dec 2015 16:49:33 +0800 Subject: [PATCH 52/76] =?UTF-8?q?issue=20=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 3 +++ app/views/issues/_list.html.erb | 2 +- app/views/issues/index.html.erb | 2 +- app/views/issues/index.js.erb | 6 +++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 48bf3b568..3263ebc07 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -87,6 +87,9 @@ class IssuesController < ApplicationController :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 diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index c071d57d8..115a70e7a 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -40,7 +40,7 @@ <%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %> <% end %> <% if issues.count == 10%> -
    展开更多<%=link_to "", project_issues_path(:project_id => project.id,:page => issue_pages.page),:id => "more_issues_link",:remote => "true",:class => "none" %>
    +
    展开更多<%=link_to "", project_issues_path({:project_id => project.id,:page => issue_pages.page}.merge(params)),:id => "more_issues_link",:remote => "true",:class => "none" %>
    <%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> <% end%> diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 7c358aaed..cf0428c27 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -144,7 +144,7 @@

    <% else %>
    - <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} %> + <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
    diff --git a/app/views/issues/index.js.erb b/app/views/issues/index.js.erb index 9e68f9bc8..9ddc50445 100644 --- a/app/views/issues/index.js.erb +++ b/app/views/issues/index.js.erb @@ -1,2 +1,6 @@ //$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>"); -$("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>"); +<% if @set_filter && @issue_pages.page == 1%> + $("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project})%>"); +<%else%> + $("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>"); +<%end%> From 66f88cdf5ad02a6c21493eabd086b48238e0bedb Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 16 Dec 2015 16:55:07 +0800 Subject: [PATCH 53/76] =?UTF-8?q?issue=20=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/index.js.erb | 2 +- public/stylesheets/project.css | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/issues/index.js.erb b/app/views/issues/index.js.erb index 9ddc50445..399c6a977 100644 --- a/app/views/issues/index.js.erb +++ b/app/views/issues/index.js.erb @@ -1,5 +1,5 @@ //$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>"); -<% if @set_filter && @issue_pages.page == 1%> +<% if @set_filter && @issue_pages.page == 1%> //只有搜索的第一页才需要替换整个issue_list,其余的都是替换show_more_issues $("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project})%>"); <%else%> $("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>"); diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index c0afe45d5..db41a1c5c 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1078,4 +1078,7 @@ img.date-trigger { } .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; } \ No newline at end of file +.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;} \ No newline at end of file From ffd8d55aa6ef3e5702f7b7da75ec535987d849a6 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 16 Dec 2015 17:08:59 +0800 Subject: [PATCH 54/76] =?UTF-8?q?memo=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) From 71f6a637e06c103e228a0d1d95ee57f4a273bad4 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 16 Dec 2015 17:26:19 +0800 Subject: [PATCH 55/76] =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=8C=89=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=80=92=E6=8E=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 4 +-- app/views/forums/show.html.erb | 6 ++-- db/schema.rb | 43 ++++++++++++++++------------ 3 files changed, 31 insertions(+), 22 deletions(-) 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/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/db/schema.rb b/db/schema.rb index 17e613acb..bcc6b2c80 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -544,26 +544,23 @@ ActiveRecord::Schema.define(:version => 20151209085942) 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 => 20151209085942) 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" From a8c8dc3cc6a913967f0b2dc29997afc08430b89a Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 16 Dec 2015 17:38:28 +0800 Subject: [PATCH 56/76] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student_work/_relate_project.html.erb | 2 +- app/views/users/_course_homework.html.erb | 24 +++++++++++------ .../users/_user_homework_detail.html.erb | 26 ++++++++++++++----- 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/app/views/student_work/_relate_project.html.erb b/app/views/student_work/_relate_project.html.erb index 43f59c9c9..9a1fcead5 100644 --- a/app/views/student_work/_relate_project.html.erb +++ b/app/views/student_work/_relate_project.html.erb @@ -4,7 +4,7 @@ <%=form_tag url_for(:controller=>'student_work',:action=>'student_work_project',:homework=>@homework.id,:user_activity_id=>@user_activity_id,:is_in_course=>@is_in_course,:course_activity =>@course_activity),:id =>'student_work_relate_project',:class=>'resourcesSearchBox',:remote => true do %>
    - +

      diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index fe02d9882..8112bc521 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -13,7 +13,7 @@ <% end %> TO <%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
      - <% end %> -
      截止时间:<%= activity.end_time.to_s %> 23:59
      @@ -93,17 +92,26 @@
      +
      +
      + 匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00 +
      +
      + 匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59 +
      +
      +
      <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
      - <% if activity.homework_type == 3 && !activity.student_work_projects.empty? && activity.homework_detail_group.base_on_project == 1 %> + <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
      + <% projects = activity.student_work_projects.where("is_leader = 1") %>
      - - 已关联项目: + 已关联项目:<%='各小组尚未将小组项目关联到本次作业。' if projects.empty? %>
      - <% activity.student_work_projects.where("is_leader = 1").each do |pro| %> + <% projects.each do |pro| %> <% project = Project.find pro.project_id %>
      -
      -
      问题跟踪
      -
      +
      +
      问题跟踪
      +
      -
      +
      <%= render :partial => 'issues/detail'%> @@ -22,30 +22,32 @@
      -
      -
      -
      回复(<%= @issue.journals.count %>)
      -
      -
      +
      +
      +
      回复(<%= @issue.journals.count %>)
      +
      +
      -
      - <%= render :partial => 'issue_replies',:locals => {:issue=>@issue,:replies_all_i=>0} %> -
      +
      + <%= render :partial => 'issue_replies',:locals => {:issue=>@issue,:replies_all_i=>0} %> +
      -
      - <%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f|%> -
      - <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %> -
      - -
      - <%= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%> -
      +
      + <%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f|%> +
      + <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
      - 发送 -
      - <% end %> -
      -
      - \ No newline at end of file + +
      + <%= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%> +
      +
      + 发送 +
      + <% end %> +
      +
      +
      +
      +
      \ No newline at end of file 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 From b02cb6fdd4c3056e820eff35881ed3008d2373c4 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 17 Dec 2015 11:30:52 +0800 Subject: [PATCH 66/76] =?UTF-8?q?issue=E7=9A=84=E4=BF=AE=E6=94=B9=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E6=9B=B4=E6=94=B9issue=E7=9A=84=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=EF=BC=8C=E9=82=A3=E4=B9=88=E5=B0=B1=E4=BC=9A=E6=9C=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82=E9=9C=80=E8=A6=81=E9=87=8D=E6=96=B0=E6=96=B0?= =?UTF-8?q?=E5=BB=BAeditor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_edit.html.erb | 3 +-- app/views/issues/_form.html.erb | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index b1127a3d3..2879c9592 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -10,8 +10,7 @@
      <%= render :partial => 'issues/form', :locals => {:f => f} %> - 确定 - 取消 +
      <%# if @journals.present? %> diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index b96b700d5..7cda806a1 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -102,3 +102,5 @@ <%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %> <% end %> + 确定 + 取消 \ No newline at end of file From de229c0f1c494a7fb9804ac8e159f36f4e634ab3 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 17 Dec 2015 14:51:02 +0800 Subject: [PATCH 67/76] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E7=9A=84=E6=96=87=E4=BB=B6=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=A2=AB=E5=BC=95=E7=94=A8=E8=87=B3=E5=BD=93=E5=89=8D=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E4=B8=8B=E7=9A=84=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 40 +++++++++++++++++++ app/controllers/files_controller.rb | 6 +++ app/helpers/application_helper.rb | 2 + app/helpers/files_helper.rb | 11 +++++ .../add_exist_file_to_org_subfield.js.erb | 8 ++++ app/views/files/_org_subfield_list.html.erb | 5 +++ ..._show_quote_resource_org_subfield.html.erb | 31 ++++++++++++++ .../quote_resource_show_org_subfield.js.erb | 11 +++++ config/locales/zh.yml | 2 + config/routes.rb | 3 +- 10 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 app/views/attachments/add_exist_file_to_org_subfield.js.erb create mode 100644 app/views/files/_show_quote_resource_org_subfield.html.erb create mode 100644 app/views/files/quote_resource_show_org_subfield.js.erb 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/files_controller.rb b/app/controllers/files_controller.rb index 0cd7d77c2..68f7cc9cb 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -412,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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9a622316a..ccbf7099a 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 diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index 276786fb7..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 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/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb index 750aed9ae..029570047 100644 --- a/app/views/files/_org_subfield_list.html.erb +++ b/app/views/files/_org_subfield_list.html.erb @@ -28,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 %>
      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/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/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 6dce046de..e68169824 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -81,7 +81,7 @@ RedmineApp::Application.routes.draw do 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 @@ -807,6 +807,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 From 4bc68081ee1983474d3bfd0903b0acf349844c20 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 17 Dec 2015 15:15:00 +0800 Subject: [PATCH 68/76] =?UTF-8?q?editor=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_issue_replies.html.erb | 27 +++- app/views/issues/add_journal.js.erb | 7 +- app/views/issues/show.html.erb | 22 +-- app/views/issues/update.js.erb | 1 + app/views/layouts/base_projects.html.erb | 1 + public/javascripts/create_kindeditor.js | 176 +++++++++++++++++++++++ 6 files changed, 215 insertions(+), 19 deletions(-) create mode 100644 public/javascripts/create_kindeditor.js diff --git a/app/views/issues/_issue_replies.html.erb b/app/views/issues/_issue_replies.html.erb index 4e68df4ef..b5142101f 100644 --- a/app/views/issues/_issue_replies.html.erb +++ b/app/views/issues/_issue_replies.html.erb @@ -31,4 +31,29 @@
      <% end %> - \ No newline at end of file + +
      + +
      + <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %> +
      + +
      +
      + <%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f|%> + <%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%> + + +
      +
      + +
      + + +
      + <% end %> +
      + +
      + +
      \ No newline at end of file diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index 5a3fa90ca..ec7401fd3 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -1,8 +1,9 @@ -<% if @issue_id%> +<% if @issue_id%> //issue详情中回复 $("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>"); $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)') - issues_reply_editor.html('') + sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); <%else%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); + init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%"); + // sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); <%end %> \ No newline at end of file diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index a1450fc03..156e5cb67 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,6 +1,10 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: true) %> + <%= javascript_include_tag 'create_kindeditor'%> <% end %> +
      +
      123
      <%= render :partial => 'layouts/new_feedback' %>
      + <%= format_time(reply.created_on) %>
      +

      @@ -76,4 +78,5 @@
      -
      \ No newline at end of file +
      +
      \ No newline at end of file diff --git a/app/views/issues/_issue_reply_ke_form.html.erb b/app/views/issues/_issue_reply_ke_form.html.erb new file mode 100644 index 000000000..e84d5905c --- /dev/null +++ b/app/views/issues/_issue_reply_ke_form.html.erb @@ -0,0 +1,27 @@ +
      + +
      + <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %> +
      + +
      +
      + <%= form_for('new_form',:url => add_reply_issue_path(@issue.id),:method => "post", :remote => true) do |f|%> + <%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%> + + + +
      +
      + +
      + + +
      + <% end %> +
      + +
      + +
      +
      \ No newline at end of file diff --git a/app/views/issues/add_reply.js.erb b/app/views/issues/add_reply.js.erb new file mode 100644 index 000000000..0ee9d30e7 --- /dev/null +++ b/app/views/issues/add_reply.js.erb @@ -0,0 +1,3 @@ +$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>"); +$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue).journals.count %>)') +sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); \ No newline at end of file diff --git a/app/views/issues/reply.js.erb b/app/views/issues/reply.js.erb new file mode 100644 index 000000000..316c078f2 --- /dev/null +++ b/app/views/issues/reply.js.erb @@ -0,0 +1,9 @@ +if($("#reply_message_<%= @jour.id%>").length > 0) { + $("#reply_message_<%= @jour.id%>").replaceWith("<%= escape_javascript(render :partial => 'issues/issue_reply_ke_form') %>"); + $(function(){ + $('input[name=quote]').val("<%= raw escape_javascript(@tempContent.html_safe) %>"); + sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); + }); +}else if($("#reply_to_message_<%= @issue.id%>").length >0) { + $("#reply_to_message_<%= @issue.id%>").replaceWith("

      "); +} \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 09b719b07..cf4262c2d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -706,7 +706,8 @@ RedmineApp::Application.routes.draw do post 'add_journal' post 'add_journal_in_org' get 'delete_journal' - post 'reply' + get 'reply' + post 'add_reply' end resources :time_entries, :controller => 'timelog' do collection do diff --git a/public/javascripts/create_kindeditor.js b/public/javascripts/create_kindeditor.js index aaadcfde4..3f555ac88 100644 --- a/public/javascripts/create_kindeditor.js +++ b/public/javascripts/create_kindeditor.js @@ -18,9 +18,6 @@ function sd_create_editor(params){ var edit = this.edit; var body = edit.doc.body; edit.iframe.height(paramsHeight); - console.log(" body.scrollHeight "+ body.scrollHeight) - console.log(" body.offsetHeight "+ body.offsetHeight) - console.log("(params.kindutil.IE ? body.scrollHeight : body.offsetHeight)"+(params.kindutil.IE ? body.scrollHeight : body.offsetHeight)) this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight)); }, afterBlur:function(){ @@ -34,7 +31,7 @@ function sd_create_editor(params){ 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("94%", null); + this.resize("100%", null); }else if(this.edit.html().trim() != ""){ params.submit_btn.show(); params.toolbar_container.show(); diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 0ed4df627..40869aca7 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/project.css b/public/stylesheets/project.css index c845b4440..1663df30f 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1082,4 +1082,6 @@ img.date-trigger { 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;} \ No newline at end of file +.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 From c7f321475a0b4f8d546eff718034ea9b7b03f987 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 17 Dec 2015 19:05:22 +0800 Subject: [PATCH 74/76] =?UTF-8?q?=E5=A4=9A=E9=80=89=E9=A2=98=E9=94=99?= =?UTF-8?q?=E5=88=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/exercise_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/exercise_helper.rb b/app/helpers/exercise_helper.rb index b0d0118e5..aba2fb58e 100644 --- a/app/helpers/exercise_helper.rb +++ b/app/helpers/exercise_helper.rb @@ -43,8 +43,9 @@ module ExerciseHelper ecs.each do |ec| arr << ec.exercise_choice.choice_position end - arr.sort - arr = arr.join("") + #arr = arr.sort + str = arr.sort.join("") + return str end # 判断用户是否已经提交了问卷 From 3b25616f0c05fde0bb1d5243bb006a060c22b560 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 17 Dec 2015 19:06:10 +0800 Subject: [PATCH 75/76] =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E6=97=B6=E5=8F=AF=E7=BC=96=E8=BE=91=E5=88=86=E7=BB=84=E6=88=90?= =?UTF-8?q?=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 28 +++++++--- .../_choose_group_member.html.erb | 12 +++++ app/views/student_work/edit.html.erb | 52 ++++++++++++++++--- public/javascripts/new_user.js | 11 +++- 4 files changed, 87 insertions(+), 16 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 650d97555..5cb646c8e 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -215,7 +215,6 @@ class StudentWorkController < ApplicationController student_work ||= StudentWork.new student_work.name = params[:student_work][:name] student_work.description = params[:student_work][:description] - student_work.project_id = params[:student_work][:project_id] student_work.homework_common_id = @homework.id student_work.user_id = User.current.id student_work.save_attachments(params[:attachments]) @@ -305,15 +304,28 @@ class StudentWorkController < ApplicationController @work.save_attachments(params[:attachments]) render_attachment_warning_if_needed(@work) if @work.save + if @homework.homework_type == 3 + @student_work_project = @homework.student_work_projects.where("user_id=?",User.current.id).first + student_work_projects = @homework.student_work_projects.where("student_work_id=? and is_leader =?",@work.id,0) + student_work_projects.delete_all + members = params[:group_member_ids].split(',') + for i in 1 .. members.count-1 + stu_project = StudentWorkProject.new + stu_project.homework_common_id = @homework.id + stu_project.student_work_id = @work.id + if @homework.homework_detail_group.base_on_project == 1 + stu_project.project_id = @student_work_project.project_id + else @homework.homework_detail_group.base_on_project == 0 + stu_project.project_id = -1 + end + stu_project.user_id = members[i].to_i + stu_project.is_leader = 0 + stu_project.save + end + end + course_message = CourseMessage.new(:user_id =>User.current.id,:content=>"edit",:course_message_id=>@work.id,:course_id => @course.id,:course_message_type=>"StudentWork", :status => 9) #作品提交记录 course_message.save -=begin - respond_to do |format| - format.html { - flash[:notice] = l(:notice_successful_edit) - redirect_to student_work_index_url(:homework => @homework.id) - } -=end @student_work = @work respond_to do |format| format.js diff --git a/app/views/student_work/_choose_group_member.html.erb b/app/views/student_work/_choose_group_member.html.erb index f94250d23..dc650cfa8 100644 --- a/app/views/student_work/_choose_group_member.html.erb +++ b/app/views/student_work/_choose_group_member.html.erb @@ -92,5 +92,17 @@ url: '<%= url_for(:controller => 'student_work', :action => 'search_course_students') %>'+'?homework='+<%=@homework.id %>, type:'get' }); + <% if defined?(edit_mode) && edit_mode %> + <% pro = @homework.student_work_projects.where("user_id = ?",User.current.id).first.project_id.to_i %> + <% members = @homework.student_work_projects.where("project_id = ? and is_leader =?",pro,0) %> + <% members.each do |member| %> + var link = "
    • <%=member.user.show_name %>"; + <% unless member.user.user_extensions.student_id == "" %> + link += "(<%=member.user.user_extensions.student_id %>)"; + <% end %> + link += "
    • "; + $("#choose_students_list").append(link); + <% end %> + <% end %> }); \ No newline at end of file diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index 6ca609502..c7c572cff 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -31,7 +31,11 @@ 提示:作品名称和描述中不要出现真实的姓名信息
      - + <% if @homework.homework_type == 3 %> + + + <%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %> + <% end %>
      @@ -51,6 +55,12 @@ <%= render :partial => 'users/user_homework_attachment', :locals => {:container => @work, :has_program=>false,:has_group=>false} %>
      + <% if @homework.homework_type == 3 %> + + <% end %> +
      确定 @@ -61,14 +71,44 @@
      \ No newline at end of file diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 67892fe0f..65741adc8 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -267,8 +267,15 @@ function edit_student_work(id) { if(regexStudentWorkName()&®exStudentWorkDescription()) { - $("#edit_student_work_" + id).submit(); - $("#ajax-indicator").hide(); + if($("#group_member_ids").length > 0) { + if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) { + $("#edit_student_work_" + id).submit(); + $("#ajax-indicator").hide(); + } + } else { + $("#edit_student_work_" + id).submit(); + $("#ajax-indicator").hide(); + } } } From c98e9fc63950d326d7ab52583bf7ce53a8019ef6 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 17 Dec 2015 22:36:18 +0800 Subject: [PATCH 76/76] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=9D=80=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_programing_work_show.html.erb | 4 +-- app/views/student_work/index.html.erb | 5 ++++ app/views/student_work/show.js.erb | 25 +++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 724163cf4..880be0ffa 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -25,8 +25,8 @@
    • 编程代码: -
      <%= text_format(work.description) if work.description%>
      -        
      +
      +
    • diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index b0e70c9b0..02a2b1707 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -1,3 +1,8 @@ +<% content_for :header_tags do %> +<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %> +<%= stylesheet_link_tag "/assets/codemirror/codemirror" %> +<% end %> +