From 808b553e435314c0a714ba51af4d47bc5dbb69d0 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jul 2016 16:50:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=8F=AA=E6=9C=8910=E6=9D=A1=EF=BC=8C=E5=BA=95=E9=83=A8?= =?UTF-8?q?=E5=8D=B4=E6=98=BE=E7=A4=BA=E2=80=9C=E7=82=B9=E5=87=BB=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E6=9B=B4=E5=A4=9A=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 18 ++++++++++-------- app/views/courses/_course_activity.html.erb | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 41ea9c45e..21dac6ada 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -888,23 +888,25 @@ class CoursesController < ApplicationController if params[:type].present? case params[:type] when "homework" - @course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc') when "news" - @course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc') when "message" - @course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc') when "poll" - @course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc') when "attachment" - @course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc') when "journalsForMessage" - @course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc') else - @course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.order('updated_at desc') end else - @course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.order('updated_at desc') end + @course_activities_count = @course_activities.count + @course_activities = @course_activities.limit(10).offset(@page * 10) @type = params[:type] @left_nav_type = 1 diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index 16d151d83..993c767d6 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -78,7 +78,7 @@ <% end %> <% end %> -<% if course_activities.count == 10 %> +<% if course_activities.count + page * 10 < @course_activities_count %> <%= link_to "点击展开更多",course_activity_path(@course.id, :type => type, :page => page),:id => "show_more_course_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> <% end %> From 6d4835c6cc70c6683c50db1fd5768e5d8ff9105d Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jul 2016 17:13:40 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/settings.html.erb | 3 +++ app/views/layouts/_syllabus_base_info.html.erb | 6 +++--- app/views/syllabuses/_syllabus_course_list.html.erb | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index edcb129a9..fabd687e0 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -1,3 +1,4 @@ +

<%= l(:label_course_modify_settings)%>

@@ -6,6 +7,7 @@ <% if @select_tab == 'member'%> $("#tb_2").click(); <% end %> + $("#homework_page_right").css("min-height",$("#courseLSide").height()+45); })
@@ -144,3 +146,4 @@ //$("#time").click(select); //$("#term").click(select); +
\ No newline at end of file diff --git a/app/views/layouts/_syllabus_base_info.html.erb b/app/views/layouts/_syllabus_base_info.html.erb index 446473db5..335dc3335 100644 --- a/app/views/layouts/_syllabus_base_info.html.erb +++ b/app/views/layouts/_syllabus_base_info.html.erb @@ -52,9 +52,9 @@
-<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?)&&(syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == ''||syllabus.credit.nil? || syllabus.credit == ''||syllabus.hours.nil? || syllabus.hours == ''||syllabus.theory_hours.nil? || syllabus.theory_hours == ''||syllabus.practice_hours.nil? || syllabus.practice_hours == ''||syllabus.applicable_major.nil? || syllabus.applicable_major == ''||syllabus.pre_course.nil? || syllabus.pre_course == '')%> - -<% end %> +<%# if User.current.logged? && (User.current == syllabus.user || User.current.admin?)&&(syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == ''||syllabus.credit.nil? || syllabus.credit == ''||syllabus.hours.nil? || syllabus.hours == ''||syllabus.theory_hours.nil? || syllabus.theory_hours == ''||syllabus.practice_hours.nil? || syllabus.practice_hours == ''||syllabus.applicable_major.nil? || syllabus.applicable_major == ''||syllabus.pre_course.nil? || syllabus.pre_course == '')%> + +<%# end %>