From 228857f20c8b72506acda073c1bc4d37af91c2c8 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 20 Feb 2016 17:23:24 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/org.css | 6 ++++-- public/stylesheets/public.css | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 4d09449b4..02b2e71bb 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -69,7 +69,7 @@ a.linkGrey8:hover {color:#585858;} .orgMenuArrow2 {background:url(../images/nav_icon.png) -10px -132px no-repeat; position:relative; display:inline-block; width:20px; height:30px;} .org_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-53px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 30px;} -#orgUserName {display:inline-block;} +#orgUserName {max-width:50px; overflow:hidden; white-space: nowrap; text-overflow: ellipsis; display:inline-block;} .org_login_list a {color:#269ac9;} .orgListStatus {width:55px; float:left;} @@ -113,4 +113,6 @@ div.flash {margin-top :0px !important} .blueBtn:hover {background-color:#298fbd;} /*文本描述展开高度*/ .maxh360 {max-height: 810px;} -.lh18 { line-height: 18px;} \ No newline at end of file +.lh18 { line-height: 18px;} + +a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; padding-left: 20px;} \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 285cac3bc..80c219350 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -255,6 +255,7 @@ a.bBlue {background-color:#3498db;} a.bBlue:hover {background-color:#297fb8;} a.submit_btn {border:1px solid #3498db; padding:3px 10px; border-radius:3px; color:#3498db;} a.submit_btn:hover {background-color:#3498db; color:#ffffff;} +a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; padding-left: 20px;} /* commonBtn */ .grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center;padding:2px 10px;} From 808f9a6b7a138fcb9cb93c9b50bc997fddf8c24a Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 20 Feb 2016 17:40:00 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E7=BB=84=E7=BB=87=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E6=A0=B7=E5=BC=8F=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/org.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 02b2e71bb..06c8022c6 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -69,7 +69,7 @@ a.linkGrey8:hover {color:#585858;} .orgMenuArrow2 {background:url(../images/nav_icon.png) -10px -132px no-repeat; position:relative; display:inline-block; width:20px; height:30px;} .org_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-53px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 30px;} -#orgUserName {max-width:50px; overflow:hidden; white-space: nowrap; text-overflow: ellipsis; display:inline-block;} +#orgUserName {display:inline-block;} .org_login_list a {color:#269ac9;} .orgListStatus {width:55px; float:left;} From d84da7908d535f3661f162a0e2e1f35018e735b2 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 20 Feb 2016 17:43:15 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E8=B0=83=E6=9F=A5=E7=BB=93=E6=9E=9C=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/_poll.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb index 75b07557e..b04f96db5 100644 --- a/app/views/poll/_poll.html.erb +++ b/app/views/poll/_poll.html.erb @@ -62,7 +62,7 @@ <% if has_commit%>
  • <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fr mr10"%>
  • <%else%> -
  • 统计结果
  • +
  • 统计结果
  • <%end%> <% end %> <% end%> \ No newline at end of file From 935ddc053a62d006524a29e4ffc52b783c036ef1 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 20 Feb 2016 17:48:45 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B9=E7=9B=AE500?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/_new_repositories.html.erb | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb index 6f01bf65c..43535153d 100644 --- a/app/views/projects/settings/_new_repositories.html.erb +++ b/app/views/projects/settings/_new_repositories.html.erb @@ -60,31 +60,6 @@ <% end %> -<<<<<<< HEAD -<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post"} do |f| %> -
    -
      -
    • - - <%= label_tag('repository_scm', - options_for_select(["Git"],@repository.class.name.demodulize), - :data => {:remote => true, :method => 'get'})%> - <% if @repository && ! @repository.class.scm_available %> - <%= l(:text_scm_command_not_available) %> - <% end %> -
    • - <% unless judge_main_repository(@project) %> -
    • - - <%= f.check_box :is_default, :label => "", :no_label => true %>

      -
    • - <% end %> -
    • - - <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %> - <% unless @repository.identifier_frozen? %> - <%=l(:text_length_between,:min=>1,:max=>254)< -======= <% if @project.repositories.any? %> <%= render :partial => 'projects/settings/rep_gitlab', :locals => {:project => @project, :ip => "ip", :project_path_cut => "project_path_cut" } %> <%#= render :partial => 'projects/settings/rep_forge', :locals => {:project => @project, :ip => "ip", :project_path_cut => "project_path_cut" } %> @@ -109,7 +84,6 @@ <%=h truncate(repository.url,:length=>10) %> <% end %> ->>>>>>> develop <% end %> From 3369183fb75d92d653c8ef2c9a349593595bf69d Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 20 Feb 2016 18:16:07 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160220100507_update_course_term.rb | 19 +++++++++++++++++++ db/schema.rb | 5 ++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20160220100507_update_course_term.rb diff --git a/db/migrate/20160220100507_update_course_term.rb b/db/migrate/20160220100507_update_course_term.rb new file mode 100644 index 000000000..afd849779 --- /dev/null +++ b/db/migrate/20160220100507_update_course_term.rb @@ -0,0 +1,19 @@ +class UpdateCourseTerm < ActiveRecord::Migration + def up + count = Course.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + Course.page(i).per(30).each do |course| + if course.end_time.nil? && course.end_term.nil? + course.end_time = course.time + course.end_term = course.term + course.save + end + end + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 1c9866602..c22b79790 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 => 20160202034530) do +ActiveRecord::Schema.define(:version => 20160220100507) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1219,7 +1219,6 @@ ActiveRecord::Schema.define(:version => 20160202034530) do create_table "org_members", :force => true do |t| t.integer "user_id" t.integer "organization_id" - t.string "role" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end @@ -1374,7 +1373,7 @@ ActiveRecord::Schema.define(:version => 20160202034530) do t.integer "changeset_num", :default => 0 t.integer "board_message_num", :default => 0 t.integer "board_num", :default => 0 - t.integer "act_num", :default => 0 + t.integer "act_num", :default => 0 t.integer "attach_num", :default => 0 t.datetime "commit_time" end From ba66425befaf5b624dff25e24f597e0983c0ed50 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 20 Feb 2016 18:26:52 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E6=8A=A5?= =?UTF-8?q?500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index e0afc38ae..e6ff904f3 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -98,14 +98,22 @@ class StudentWorkController < ApplicationController elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first - @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id) + if pro.nil? + @stundet_works = [] + else + @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id) + end else @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) end elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first - my_work = @homework.student_works.where(:id => pro.student_work_id) + if pro.nil? + my_work = [] + else + my_work = @homework.student_works.where(:id => pro.student_work_id) + end else my_work = @homework.student_works.where(:user_id => User.current.id) end @@ -113,7 +121,11 @@ class StudentWorkController < ApplicationController elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first - my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id) + if pro.nil? + my_work = [] + else + my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id) + end else my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) end @@ -134,14 +146,22 @@ class StudentWorkController < ApplicationController elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first - @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id) + if pro.nil? + @stundet_works = [] + else + @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id) + end else @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) end elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first - my_work = @homework.student_works.where(:id => pro.student_work_id) + if pro.nil? + my_work = [] + else + my_work = @homework.student_works.where(:id => pro.student_work_id) + end else my_work = @homework.student_works.where(:user_id => User.current.id) end @@ -149,7 +169,11 @@ class StudentWorkController < ApplicationController elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first - my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id) + if pro.nil? + my_work = [] + else + my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id) + end else my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) end From c1a84e2ce5141fa6ab810b22aea3d67725bf0926 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 22 Feb 2016 11:14:26 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E7=BB=84=E7=BB=87=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E7=9A=84=E7=94=A8=E6=88=B7=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E6=94=B9=E6=88=90https://www.trustie.net=E7=9A=84?= =?UTF-8?q?=E5=BD=A2=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 9f026d69d..81c6e82a5 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -44,8 +44,8 @@
    • <% if User.current.logged? %> From 278139104b8c2e2922d2c42212bf918ce236ed11 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 22 Feb 2016 15:09:07 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E5=85=81=E8=AE=B8=E8=80=81=E5=B8=88?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=A7=8B=E5=AD=A6=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/settings.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index 617cefc93..b0c4a067f 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -139,6 +139,6 @@ $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("anonymos"); } - $("#time").click(select); - $("#term").click(select); + //$("#time").click(select); + //$("#term").click(select); From 98946b98552be3e4c8ebc6cced2ef16c6c877423 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 22 Feb 2016 18:10:20 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BC=B9=E6=A1=86=E7=9A=84=E5=BB=B6=E8=BF=9F?= =?UTF-8?q?=E5=8F=91=E5=B8=83=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 | 17 ++++++ app/controllers/users_controller.rb | 14 ++--- app/helpers/courses_helper.rb | 2 +- app/helpers/files_helper.rb | 3 +- app/views/files/_course_list.html.erb | 3 ++ app/views/files/_upload_course_files.erb | 53 ++++++++++++++++--- ...160222064143_add_publish_to_attachments.rb | 21 ++++++++ 7 files changed, 98 insertions(+), 15 deletions(-) create mode 100644 db/migrate/20160222064143_add_publish_to_attachments.rb diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index c4932b1b2..e83a13ad9 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -488,6 +488,23 @@ class FilesController < ApplicationController if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added') Mailer.run.attachments_added(attachments[:files]) end + if !attachments.empty? && attachments[:files] + attachments[:files].each do |attachment| + if params[:publish_time] + if params[:publish_time] == "" + attachment.publish_time = Date.today + else + attachment.publish_time = params[:publish_time] + end + else + attachment.publish_time = Date.today + end + if attachment.publish_time > Date.today + attachment.is_publish = 0 + end + attachment.save + end + end if params[:course_attachment_type] && params[:course_attachment_type].is_a?(Array) params[:course_attachment_type].each do |type| tag_name = get_tag_name_by_type_number type diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 625a1de74..fb35d8495 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2144,22 +2144,22 @@ class UsersController < ApplicationController if(params[:type].blank? || params[:type] == "1") #全部 if User.current.id.to_i == params[:id].to_i user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 - @attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ - "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc") + @attachments = Attachment.where("(author_id = #{params[:id]} and is_publish = 1 and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+ + "or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1)").order("created_on desc") else user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #Ta的资源库的话,应该是他上传的公开资源 加上 他加入的所有我可见课程里的公开资源 - @attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 " + + @attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 and is_publish = 1 " + "and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) " + - "or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc") + "or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1)").order("created_on desc") end elsif params[:type] == "2" #课程资源 if User.current.id.to_i == params[:id].to_i user_course_ids = User.current.courses.map { |c| c.id} - @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) ").order("created_on desc") + @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course' and is_publish = 1) or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1) ").order("created_on desc") else user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中 - @attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 and container_type = 'Course')"+ - "or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc") + @attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 and container_type = 'Course' and is_publish = 1)"+ + "or (container_type = 'Course' and is_public = 1 and is_publish = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc") end elsif params[:type] == "3" #项目资源 if User.current.id.to_i == params[:id].to_i diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 40ed4a21a..6d0066fbc 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -746,7 +746,7 @@ module CoursesHelper return[] unless course result = [] course.attachments.each do |attachment| - if attachment.is_public? || User.current.member_of_course?(course) || User.current.admin? + if attachment.is_public? ||User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id))|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin? result << attachment end end diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index bd023f6d0..6b748649b 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -123,7 +123,8 @@ module FilesHelper attachments.each do |attachment| if attachment.is_public? || (attachment.container_type == "Project" && User.current.member_of?(attachment.project)) || - (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))|| + (attachment.container_type == "Course" && User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id)))|| + (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)) && attachment.is_publish == 1)|| attachment.author_id == User.current.id || attachment.container_type == "OrgSubfield" result << attachment diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index 47c08d2fb..d7aade6c2 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -18,6 +18,9 @@ 私有 <%end %> + <% if file.is_publish == 0 %> + <%=file.publish_time %>  0点发布 + <% end %>
    上传时间:<%= format_time(file.created_on)%> diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb index 6cce4bf2e..2e53f05d2 100644 --- a/app/views/files/_upload_course_files.erb +++ b/app/views/files/_upload_course_files.erb @@ -21,10 +21,20 @@ <%= render :partial => 'files/new_style_attachment_list',:locals => {:container => course} %>
    - - <%= l(:button_cancel)%> - - <%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %> + <% if User.current.allowed_to?(:as_teacher,course) %> +
    + +
    + + <%#= calendar_for('attachment_publish_time')%> +
    + +
    +
    + <% end %> + <%= l(:button_cancel)%> + <%= l(:button_confirm)%> + <%#= submit_tag '确定',:onclick=>'submit_course_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %> <% end %> @@ -35,8 +45,39 @@ \ No newline at end of file diff --git a/db/migrate/20160222064143_add_publish_to_attachments.rb b/db/migrate/20160222064143_add_publish_to_attachments.rb new file mode 100644 index 000000000..5ca354396 --- /dev/null +++ b/db/migrate/20160222064143_add_publish_to_attachments.rb @@ -0,0 +1,21 @@ +class AddPublishToAttachments < ActiveRecord::Migration + def change + add_column :attachments, :is_publish, :integer, :default => 1 + add_column :attachments, :publish_time, :date +=begin + count = Attachment.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + Attachment.page(i).per(30).each do |atta| + begin + atta.publish_time = atta.created_on.strftime('%d-%b-%Y') + atta.save + ensure + logger.error("===================>>container_id is null") + end + end + end + end +=end + end +end From 6b4be999ee12dd494241794042cd97c27da2c586 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 22 Feb 2016 18:35:04 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=9A=84=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/resource_publish.rake | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/tasks/resource_publish.rake diff --git a/lib/tasks/resource_publish.rake b/lib/tasks/resource_publish.rake new file mode 100644 index 000000000..2df0c6145 --- /dev/null +++ b/lib/tasks/resource_publish.rake @@ -0,0 +1,11 @@ +#coding=utf-8 + +namespace :resource_publish do + desc "start publish resource" + task :publish => :environment do + attachments = Attachment.where("publish_time = '#{Date.today}'") + attachments.each do |attachment| + attachment.update_column('is_publish', 1) + end + end +end \ No newline at end of file From a2e60944be2fd3e8fcd9e9e1f6fc6316164c9406 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 23 Feb 2016 11:04:19 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E5=B7=B2=E5=8F=91=E5=B8=83=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E7=9A=84=E5=BB=B6=E6=9C=9F=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 27 +++++++- app/helpers/courses_helper.rb | 2 +- app/views/files/_course_list.html.erb | 80 +---------------------- app/views/files/_hidden_file.html.erb | 54 +++++++++++++++ app/views/files/_resource_detail.html.erb | 77 ++++++++++++++++++++++ app/views/files/_upload_course_files.erb | 2 +- app/views/files/file_hidden.js.erb | 6 ++ app/views/files/republish_file.js.erb | 2 + config/routes.rb | 3 + 9 files changed, 173 insertions(+), 80 deletions(-) create mode 100644 app/views/files/_hidden_file.html.erb create mode 100644 app/views/files/_resource_detail.html.erb create mode 100644 app/views/files/file_hidden.js.erb create mode 100644 app/views/files/republish_file.js.erb diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index e83a13ad9..b18612243 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -26,7 +26,7 @@ class FilesController < ApplicationController before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project, :search_tag_attachment,:subfield_upload_file,:search_org_subfield_tag_attachment, :search_tag_attachment,:quote_resource_show_org_subfield,:find_org_subfield_attache, - :search_files_in_subfield,:upload_files_menu] + :search_files_in_subfield,:upload_files_menu,:file_hidden,:republish_file] helper :sort include SortHelper @@ -96,6 +96,31 @@ class FilesController < ApplicationController end end + def file_hidden + @file = Attachment.find params[:id] + @course = Course.find params[:course_id] + respond_to do |format| + format.js + end + end + + def republish_file + @file = Attachment.find params[:id] + @course = Course.find params[:course_id] + if params[:publish_time] + unless params[:publish_time] == "" + @file.publish_time = params[:publish_time] + end + end + if @file.publish_time > Date.today + @file.is_publish = 0 + end + @file.save + respond_to do |format| + format.js + end + end + def search_project sort = "" @sort = "" diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 6d0066fbc..2cdb277be 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -746,7 +746,7 @@ module CoursesHelper return[] unless course result = [] course.attachments.each do |attachment| - if attachment.is_public? ||User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id))|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin? + if attachment.is_public? ||User.current == attachment.author ||User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id))|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin? result << attachment end end diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index d7aade6c2..7724bb861 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -1,82 +1,8 @@ - -<% delete_allowed = User.current.allowed_to?(:manage_files, course) %> <% curse_attachments.each do |file| %> <% if file.is_public? || User.current.member_of_course?(course) || User.current.admin? %> -
    -
    -
    - <%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %> -
    -
    -
    - <%= link_to truncate(file.filename,length: 35, omission: '...'), - 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 => "linkBlue f_14 f_b" %> - <%= file_preview_eye(file, class: 'preview') %> - - <% if file.is_public? == false%> - 私有 - <%end %> - - <% if file.is_publish == 0 %> - <%=file.publish_time %>  0点发布 - <% end %> -
    -
    - 上传时间:<%= format_time(file.created_on)%> - <% if file.tag_list.length > 0%> - 上传类型:<%= file.tag_list[0] %> - <% end %> -

    文件大小:<%= number_to_human_size(file.filesize) %>

    -

    下载<%= file.downloads%>  |  引用<%= file.quotes.nil? ? 0:file.quotes %>

    -
    -
    -
    - - <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> - <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> -
    -
    - -
      -
    • - <% if User.current.logged? %> - - <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> - <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %> -
        - -
      • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
      • -
      • <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
      • - <% if @course.is_public? %> -
      • - - <%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %> - -
      • - <%end%> -
      • - <%= link_to( '删除资源', attachment_path(file), - :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %> -
      • -
      - - <% end %> - <%else%> -
        -
      • <%= link_to("发  送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
      • -
      - <% end %> - <% end %> -
    • -
    - -
    -
    -
    -
    -
    -
    +
    + <%=render :partial=>'files/resource_detail',:locals => {:file => file} %> +
    <% else %>
    <%= file.filename %>是私有资源
    <% end %> diff --git a/app/views/files/_hidden_file.html.erb b/app/views/files/_hidden_file.html.erb new file mode 100644 index 000000000..eb0f366a3 --- /dev/null +++ b/app/views/files/_hidden_file.html.erb @@ -0,0 +1,54 @@ +发布设置 + +<%= form_tag(republish_file_course_file_path(@course,@file), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> +
    + +
    + + <%#= calendar_for('attachment_publish_time')%> +
    + +
    +
    + +
    + + +
    +<% end %> +
    + \ No newline at end of file diff --git a/app/views/files/_resource_detail.html.erb b/app/views/files/_resource_detail.html.erb new file mode 100644 index 000000000..fd0a165aa --- /dev/null +++ b/app/views/files/_resource_detail.html.erb @@ -0,0 +1,77 @@ +<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %> +
    +
    +
    + <%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %> +
    +
    +
    + <%= link_to truncate(file.filename,length: 35, omission: '...'), + 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 => "linkBlue f_14 f_b" %> + <%= file_preview_eye(file, class: 'preview') %> + + <% if file.is_public? == false%> + 私有 + <%end %> + + <% if file.is_publish == 0 %> + <%=file.publish_time %>  0点发布 + <% end %> +
    +
    + 上传时间:<%= format_time(file.created_on)%> + <% if file.tag_list.length > 0%> + 上传类型:<%= file.tag_list[0] %> + <% end %> +

    文件大小:<%= number_to_human_size(file.filesize) %>

    +

    下载<%= file.downloads%>  |  引用<%= file.quotes.nil? ? 0:file.quotes %>

    +
    +
    +
    + + <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> + <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> +
    +
    + +
      +
    • + <% if User.current.logged? %> + + <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> + <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %> +
        + +
      • <%= link_to("发       送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
      • +
      • <%= link_to '延期发布',file_hidden_course_file_path(@course,file),:class => "postOptionLink",:remote=>true %>
      • +
      • <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
      • + <% if @course.is_public? %> +
      • + + <%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %> + +
      • + <%end%> +
      • + <%= link_to( '删除资源', attachment_path(file), + :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %> +
      • +
      + + <% end %> + <%else%> +
        +
      • <%= link_to("发  送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %>
      • +
      + <% end %> + <% end %> +
    • +
    + +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb index 2e53f05d2..1b8b140a5 100644 --- a/app/views/files/_upload_course_files.erb +++ b/app/views/files/_upload_course_files.erb @@ -28,7 +28,7 @@ <%#= calendar_for('attachment_publish_time')%> - +
    <% end %> diff --git a/app/views/files/file_hidden.js.erb b/app/views/files/file_hidden.js.erb new file mode 100644 index 000000000..b95ab5104 --- /dev/null +++ b/app/views/files/file_hidden.js.erb @@ -0,0 +1,6 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/hidden_file',:locals => {:course => @course,:course_attachment_type => 1}) %>'); +showModal('ajax-modal', '311px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before(""); +$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); +$('#ajax-modal').parent().addClass("popbox_polls"); \ No newline at end of file diff --git a/app/views/files/republish_file.js.erb b/app/views/files/republish_file.js.erb new file mode 100644 index 000000000..e85e5eb50 --- /dev/null +++ b/app/views/files/republish_file.js.erb @@ -0,0 +1,2 @@ +hideModal(); +$("#resource_detail_<%=@file.id %>").html("<%= escape_javascript(render :partial=>'files/resource_detail',:locals => {:file => @file}) %>") \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 7060e4eb6..095470139 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -695,6 +695,7 @@ RedmineApp::Application.routes.draw do end member do match "quote_resource_show", :via => [:get] + get "file_hidden" end end @@ -1015,6 +1016,8 @@ RedmineApp::Application.routes.draw do end member do match "quote_resource_show", :via => [:get] + get "file_hidden" + post "republish_file" end end resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do From b6bf78a5df895e00e08f5e1ebebe8f0f0b9b04b8 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 23 Feb 2016 11:35:07 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E5=BD=93=E5=A4=A9=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E7=9A=84=E8=B5=84=E6=BA=90=E6=98=BE=E7=A4=BA=E6=9C=AA=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E3=80=81=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E7=94=A8=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 2 ++ app/views/files/_hidden_file.html.erb | 1 + app/views/files/_upload_course_files.erb | 1 + 3 files changed, 4 insertions(+) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index b18612243..ca37e445c 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -114,6 +114,8 @@ class FilesController < ApplicationController end if @file.publish_time > Date.today @file.is_publish = 0 + else + @file.is_publish = 1 end @file.save respond_to do |format| diff --git a/app/views/files/_hidden_file.html.erb b/app/views/files/_hidden_file.html.erb index eb0f366a3..8e359c605 100644 --- a/app/views/files/_hidden_file.html.erb +++ b/app/views/files/_hidden_file.html.erb @@ -1,3 +1,4 @@ + 发布设置 <%= form_tag(republish_file_course_file_path(@course,@file), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb index 1b8b140a5..de43977cd 100644 --- a/app/views/files/_upload_course_files.erb +++ b/app/views/files/_upload_course_files.erb @@ -1,3 +1,4 @@ +

    <%= l(:label_upload_files)%>

    From c91ef44570f7941f759a82bfbdb3d87dab1f67ac Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 23 Feb 2016 12:52:04 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=AD=90=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=EF=BC=9A=E6=89=80=E6=9C=89=E5=AD=90=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=88=B0secdomains=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E7=BB=84=E7=BB=87=E8=A1=A8=E4=B8=AD=E7=9A=84=E5=AD=90?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E8=BF=81=E7=A7=BB=E5=88=B0secdomains?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=EF=BC=8C=E5=B9=B6=E4=BF=AE=E6=94=B9=E7=9B=B8?= =?UTF-8?q?=E5=BA=94=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/org_subfields_controller.rb | 3 ++- app/controllers/organizations_controller.rb | 9 +++++++-- app/views/organizations/_subfield_list.html.erb | 2 +- app/views/organizations/setting.html.erb | 11 ++++++----- app/views/users/user_organizations.html.erb | 5 ----- .../20160223021012_add_index_to_secdomain.rb | 5 +++++ .../20160223021227_move_domain_to_secdomain.rb | 14 ++++++++++++++ ...60223031843_remove_domain_from_organizations.rb | 8 ++++++++ db/schema.rb | 9 +++++++-- 9 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 db/migrate/20160223021012_add_index_to_secdomain.rb create mode 100644 db/migrate/20160223021227_move_domain_to_secdomain.rb create mode 100644 db/migrate/20160223031843_remove_domain_from_organizations.rb diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index bae0232a5..2a4bcf9c8 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -30,7 +30,8 @@ class OrgSubfieldsController < ApplicationController if params[:id] @organization = Organization.find(params[:id]) else - @organization = Organization.where("domain=?",request.subdomain).first + domain = Secdomain.where("subname=?", request.subdomain).first + @organization = Organization.find(domain.pid) end @org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+ "subfield_subdomain_dirs where org_subfields.id = subfield_subdomain_dirs.org_subfield_id and "+ diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 6e2da311f..f225e7f50 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -139,7 +139,7 @@ class OrganizationsController < ApplicationController end def check_uniq_domain - @is_exist = (Organization.where("domain=?", params[:org_domain]).count > 0) + @is_exist = (Secdomain.where("subname=?",params[:org_domain]).count > 0) end def find_organization @@ -322,7 +322,12 @@ class OrganizationsController < ApplicationController def agree_apply_subdomain @organization = Organization.find(params[:organization_id]) OrgMessage.find(params[:act_id]).update_attribute(:viewed, 1) - @organization.update_attribute(:domain, params[:org_domain]) + if Secdomain.where("pid=? and sub_type=2",@organization.id).count > 0 + domain = Secdomain.where("pid=? and sub_type=2",params[:organization_id]).first + Secdomain.update(domain.id, :subname => params[:org_domain]) + else + Secdomain.create(:sub_type => 2, :pid => params[:organization_id], :subname => params[:org_domain]) + end if OrgMessage.where("message_type='AgreeApplySubdomain' and organization_id=#{@organization.id} and content=?",params[:org_domain]).count == 0 OrgMessage.create(:user_id => params[:user_id], :organization_id => @organization.id, :message_type => 'AgreeApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:org_domain]) end diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index b49436d4e..eed0dabf6 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -28,7 +28,7 @@
  • 新增
  • <%= field.field_type == "Post" ? "帖子" : "资源" %>
  • <% else %> - - + + <% end %> <% else %> diff --git a/app/views/news/_course_news_detail.html.erb b/app/views/news/_course_news_detail.html.erb index 61db84134..bd3215fb3 100644 --- a/app/views/news/_course_news_detail.html.erb +++ b/app/views/news/_course_news_detail.html.erb @@ -3,18 +3,6 @@ <%= javascript_include_tag "create_kindeditor" %> <% end %> - <% if newss%> <% newss.each do |news| %> - + <% unless forge_acts.empty? %> <% forge_acts.each do |activity| -%> - + <% user_activities.each do |user_activity| if user_activities %>