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 01/54] =?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 02/54] =?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 %>
    - @@ -40,11 +39,10 @@

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

    - - - - - +
    + <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %> + <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %> +
    <% end %> diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb index b0bc9ea09..2a552dc43 100644 --- a/app/views/files/_subfield_files.html.erb +++ b/app/views/files/_subfield_files.html.erb @@ -70,7 +70,7 @@
    <%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search f_l",:remote=>true) do %> <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%> - <%= submit_tag "栏目内搜索", :class => "re_schbtn b_lblue",:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %> + <%= submit_tag "栏目内搜索", :class => "re_schbtn b_lblue",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %> <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <% end %> <%# if is_org_subfield_teacher(User.current,@org_subfield) || (@org_subfield.publish_resource==1 && User.current.member_of_org_subfield?(@org_subfield) ) %> @@ -88,7 +88,7 @@
    -
    +
    <%= render :partial => 'org_subfield_list',:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments} %>
    From 14912078ee3067a922e7a61886f763a3ed14c195 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 14 Dec 2015 11:03:04 +0800 Subject: [PATCH 07/54] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cbc646eac..ad4da60a7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1934,6 +1934,8 @@ module ApplicationHelper candown = true elsif attachment.container.class.to_s=="StudentWork" candown = true + elsif attachment.container.class.to_s=="BlogComment" #博客资源允许下载 + candown = true elsif attachment.container.class.to_s == "User" candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id) elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses From 9aebafee09990cdd25fb4bafa0d9977e3b6c381b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 14 Dec 2015 11:11:09 +0800 Subject: [PATCH 08/54] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=B7=BB=E5=8A=A0?= =?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 | 6 +++++- app/views/welcome/_search_course_results.html.erb | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/views/welcome/_search_all_results.html.erb b/app/views/welcome/_search_all_results.html.erb index 537da336a..4ed9fba33 100644 --- a/app/views/welcome/_search_all_results.html.erb +++ b/app/views/welcome/_search_all_results.html.erb @@ -37,7 +37,11 @@
  • <%= item.try(:highlight).try(:description) ? item.highlight.description[0].html_safe : item.description %>
  • -
  • 教师:<%= User.find(item.tea_id).realname %>授课时间:<%= item.time.to_s + item.term%><%= User.find(item.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(item.tea_id).user_extensions.occupation : ''%>
  • +
  • + 教师:<%= User.find(item.tea_id).realname %> + 授课时间:<%= item.time.to_s + item.term%> + 更新时间:<%= format_date(item.updated_at)%> + <%= User.find(item.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(item.tea_id).user_extensions.occupation : ''%>
  • diff --git a/app/views/welcome/_search_course_results.html.erb b/app/views/welcome/_search_course_results.html.erb index 89567063d..e51452ada 100644 --- a/app/views/welcome/_search_course_results.html.erb +++ b/app/views/welcome/_search_course_results.html.erb @@ -12,7 +12,11 @@
  • <%= course.try(:highlight).try(:description) ? course.highlight.description[0].html_safe : (course.description.present? ? course.description : '暂时没有该课程描述') %>
  • -
  • 教师:<%= User.find(course.tea_id).realname %>授课时间:<%= course.time.to_s + course.term%><%= User.find(course.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(course.tea_id).user_extensions.occupation : ''%>
  • +
  • + 教师:<%= User.find(course.tea_id).realname %> + 授课时间:<%= course.time.to_s + course.term%> + 更新时间:<%= format_date(course.updated_at)%> + <%= User.find(course.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(course.tea_id).user_extensions.occupation : ''%>
  • From f3013ca3e71dc61effbedb4a733ad41c2fbe7919 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 14 Dec 2015 11:22:36 +0800 Subject: [PATCH 09/54] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=9A=84=E6=8F=90=E7=A4=BA=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_header.html.erb | 2 +- app/views/layouts/_unlogin_header.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index d100e79a5..a0cbe4eed 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -54,7 +54,7 @@ <% name = name%> <%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %> - " id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户以及资源"/> + " id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户、资源以及帖子"/> diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb index 162f59ed4..7a2196d01 100644 --- a/app/views/layouts/_unlogin_header.html.erb +++ b/app/views/layouts/_unlogin_header.html.erb @@ -52,7 +52,7 @@ <% name = name%> <%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %> - " id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户以及资源" onkeypress="search_in_header_I(event,$(this));"/> + " id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户、资源以及帖子" onkeypress="search_in_header_I(event,$(this));"/> From a5fa68c9289c7220a25e7901accc11e029999052 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 14 Dec 2015 16:41:18 +0800 Subject: [PATCH 10/54] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 6 +++++- app/views/files/_upload_subfield_file.html.erb | 6 ++---- app/views/files/subfield_upload_file.js.erb | 6 ++++++ app/views/layouts/base_org.html.erb | 4 ++-- app/views/organizations/_org_left_subfield_list.html.erb | 6 +++++- config/routes.rb | 1 + public/stylesheets/org.css | 4 +++- 7 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 app/views/files/subfield_upload_file.js.erb diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 6ed42bd6e..7b375377c 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -392,8 +392,8 @@ class FilesController < ApplicationController sort = "#{Attachment.table_name}.created_on desc" end @container_type = 2 - @organization = Organization.find(params[:organization_id]) @containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)] + @organization = Organization.find(@containers.first.organization_id) show_attachments @containers render :layout => 'base_org' # @subfield = params[:org_subfield_id] @@ -733,4 +733,8 @@ class FilesController < ApplicationController # format.html end end + + def subfield_upload_file + @org_subfield = OrgSubfield.find(params[:org_subfield_id]) + end end diff --git a/app/views/files/_upload_subfield_file.html.erb b/app/views/files/_upload_subfield_file.html.erb index c3ca72ecd..5d8723d03 100644 --- a/app/views/files/_upload_subfield_file.html.erb +++ b/app/views/files/_upload_subfield_file.html.erb @@ -10,7 +10,7 @@ - <%= render :partial => 'files/attachement_list',:locals => {:org_subfield => org_subfield} %> + <%= render :partial => 'files/attachement_list'%>
    <%= l(:button_cancel)%> <%= l(:button_confirm)%> @@ -18,9 +18,7 @@
    - <% content_for :header_tags do %> - <%= javascript_include_tag 'attachments' %> - <% end %> + - <% 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 af157a9c63350ffd25865266f681bb9af778dfc4 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 15 Dec 2015 17:30:24 +0800 Subject: [PATCH 14/54] =?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 ef2f142f626d7162116fee4d8fb2cdc7708b28cc Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 15 Dec 2015 18:12:32 +0800 Subject: [PATCH 15/54] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index aed57010b..81d42c1e6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1936,6 +1936,8 @@ module ApplicationHelper candown = true elsif attachment.container.class.to_s=="BlogComment" #博客资源允许下载 candown = true + elsif attachment.container.class.to_s=="Memo" #论坛资源允许下载 + candown = true elsif attachment.container.class.to_s == "User" candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id) elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses From 68aceaa7dfbdbd68bfde084fca7fc6402b4ecaf4 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 15 Dec 2015 18:43:58 +0800 Subject: [PATCH 16/54] =?UTF-8?q?issue=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 4 + app/views/issues/_action_menu.html.erb | 4 +- app/views/issues/_attributes.html.erb | 5 +- app/views/issues/_attributes_show.html.erb | 2 +- app/views/issues/_detail.html.erb | 36 +++++ app/views/issues/_edit.html.erb | 38 ++--- app/views/issues/_form.html.erb | 2 +- app/views/issues/_issue_replies.html.erb | 34 +++++ app/views/issues/add_journal.js.erb | 11 +- app/views/issues/show.html.erb | 139 ++++++------------ app/views/issues/update.js.erb | 5 + .../lib/rails_kindeditor/helper.rb | 8 +- public/assets/kindeditor/kindeditor.js | 28 ++-- .../plugins/autoheight/autoheight.js | 4 +- public/javascripts/project.js | 10 ++ public/stylesheets/project.css | 15 +- public/stylesheets/public.css | 3 +- 17 files changed, 200 insertions(+), 148 deletions(-) create mode 100644 app/views/issues/_detail.html.erb create mode 100644 app/views/issues/_issue_replies.html.erb create mode 100644 app/views/issues/update.js.erb diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 7cdc838e2..9bb602178 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -256,6 +256,7 @@ class IssuesController < ApplicationController end flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record? respond_to do |format| + format.js format.html { redirect_to issue_url(@issue.id) } format.api { render_api_ok } end @@ -398,6 +399,9 @@ class IssuesController < ApplicationController user_activity.updated_at = jour.created_on user_activity.save @user_activity_id = params[:user_activity_id] + if params[:issue_id] + @issue_id = params[:issue_id] + end respond_to do |format| format.js end diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index ae2a848e0..97e95d4a9 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -2,5 +2,5 @@ <%#= watcher_link_issue(@issue, User.current) %> <%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'talk_edit fr' if User.current.allowed_to?(:add_issues, @project) %> <%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %> -<%= link_to l(:button_edit), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> -<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> +<%= link_to l(:button_edit), 'javascript:void(0);', :onclick => 'issueEditShow();', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> +<%#= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index 54cb85212..1b6bebb01 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -1,7 +1,6 @@ <%= labelled_fields_for :issue, @issue do |f| %>
    -
    - <%= l(:label_change_properties) %> +
    • @@ -54,7 +53,7 @@
    -
      +
      • <% if @issue.safe_attribute? 'start_date' %> diff --git a/app/views/issues/_attributes_show.html.erb b/app/views/issues/_attributes_show.html.erb index 7b9e2bedf..15160facb 100644 --- a/app/views/issues/_attributes_show.html.erb +++ b/app/views/issues/_attributes_show.html.erb @@ -1,5 +1,5 @@ -
        +
        <%= issue_fields_rows do |rows| %>
        •  状态  : 

          <%= @issue.status.name %>

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

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

          +
          +
          + 由<%= @issue.author %>添加于 <%= format_time(@issue.created_on).html_safe %> +
          + + + +<%= render :partial => 'action_menu' %> +
          +<% if @issue.description? || @issue.attachments.any? -%> +
          + <% if @issue.description? %> + <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> + <%= textAreailizable @issue, :description, :attachments => @issue.attachments %> + <% end %> +
          +<% end -%> +<% if @issue.attachments.any? %> +
          + + + <%= link_to_attachment_project @issue, :thumbnails => true %>
          + <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %> +
          +
          +<% end %> + + +<%= render :partial => 'issues/attributes_show' %> +
          \ No newline at end of file diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index b8f362429..87430e5d6 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -3,44 +3,26 @@ <% end %> -<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %> +<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true,:remote=>true} do |f| %> <%= error_messages_for 'issue', 'time_entry' %> <%= render :partial => 'conflict' if @conflict %> - <% if @edit_allowed || !@allowed_statuses.empty? %> -
        • 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 30/54] =?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 31/54] =?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 32/54] =?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 33/54] =?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 34/54] =?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 44/54] =?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 45/54] =?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 46/54] =?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 52/54] =?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 53/54] =?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 54/54] =?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 %> +