diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index ff26d45b0..d2d9a2360 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -1,6 +1,8 @@ class HomeworkAttachController < ApplicationController layout "course_base" include CoursesHelper + + helper :words ############################### before_filter :can_show_course,except: [] #判断当前角色权限时需先找到当前操作的project @@ -65,6 +67,14 @@ class HomeworkAttachController < ApplicationController #获取作业的留言列表 def get_homework_jours + #@user = @bid.author + @jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') + @limit = 10 + @feedback_count = @jours.count + @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] + @offset ||= @feedback_pages.offset + @jour = @jours[@offset, @limit] + @state = false respond_to do |format| format.js end diff --git a/app/views/homework_attach/_homework_jours.html.erb b/app/views/homework_attach/_homework_jours.html.erb index 375f2fda4..0d4b666e2 100644 --- a/app/views/homework_attach/_homework_jours.html.erb +++ b/app/views/homework_attach/_homework_jours.html.erb @@ -4,4 +4,69 @@ 取  消留  言 +<% reply_allow = JournalsForMessage.create_by_user? User.current %> +<% label = '' + case bid.reward_type + when 1 + label = l(:label_respond_requirement) + when 2 + label = l(:label_contest_requirement) + when 3 + label = l(:label_question_requirement) + else + end +%> +<% if journals.size > 0 %> + +<% end %>
\ No newline at end of file diff --git a/app/views/homework_attach/get_homework_jours.js.erb b/app/views/homework_attach/get_homework_jours.js.erb index 94c564612..9de26eb41 100644 --- a/app/views/homework_attach/get_homework_jours.js.erb +++ b/app/views/homework_attach/get_homework_jours.js.erb @@ -1,3 +1,3 @@ -$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homework_jours' )) %>'); +$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homework_jours',:locals => { :bid => @bid, :journals => @jour, :state => false} )) %>'); for(var i=1;i<=5;i++){$("#tb_"+i).removeClass().addClass("normaltab");} $("#tb_5").removeClass().addClass("hovertab"); \ No newline at end of file