diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index fb22d6378..cac8eaf0a 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -1,7 +1,7 @@ class HomeworkCommonController < ApplicationController layout "base_courses" before_filter :find_course, :only => [:index,:new,:create] - before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment] + before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy] before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment] def index @@ -120,7 +120,11 @@ class HomeworkCommonController < ApplicationController end def destroy - + if @homework.destroy + respond_to do |format| + format.html {redirect_to homework_common_index_path(:course => @course.id)} + end + end end #开启匿评 diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index e97938633..015df90c5 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -26,6 +26,7 @@

<% if @is_teacher%> <%= homework_anonymous_comment(homework)%> + <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %> <%= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %> <% elsif @is_student%> <%= student_anonymous_comment homework %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 67be22e19..8adf7d492 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -878,7 +878,6 @@ zh: button_copy_and_follow: 复制并转到新问题 button_annotate: 追溯 - button_edit: 编辑 button_configure: 配置 button_quote: 引用 button_duplicate: 副本 diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index cb47abb09..9d88470c9 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -147,7 +147,6 @@ a:hover.work_edit{color: #fff; background: #64bdd9;} .hovertab a{color:#fff; background-color:#64bdd9; text-decoration:none;} .dis{display:block; } .undis{display:none;} -.c_red{ color:#de030d;} .f_12{ font-size:12px;} .w_40{ width:40px; border:1px solid red;} .dis_ul{ height:70px; border-bottom:1px dashed #d4d4d4; margin-bottom:10px;}