From 364ac065275362457569ec4de61eccfff066f076 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 31 Oct 2014 14:06:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=9B=9E=E5=A4=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 10 +++ .../homework_attach/_homework_jours.html.erb | 65 +++++++++++++++++++ .../homework_attach/get_homework_jours.js.erb | 2 +- 3 files changed, 76 insertions(+), 1 deletion(-) 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