From a0ca31780ebfda02d476c00fccc5e63532bbb04d Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 21 May 2015 16:35:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E3=80=8B=E3=80=8A=E8=B5=84=E6=BA=90=E5=8C=BA?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E9=94=99=E8=AF=AF=E3=80=8B=E3=80=8A=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=9B=9E=E5=B8=96=E5=9B=9E=E5=A4=8D=E3=80=8B=E3=80=8A?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=BE=91=E5=99=A8=E3=80=8B=20?= =?UTF-8?q?=E3=80=8A=E5=B1=95=E5=BC=80=EF=BC=8C=E6=94=B6=E8=B5=B7=EF=BC=8C?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=9B=9E=E5=A4=8D=EF=BC=8C=E6=94=B6=E8=B5=B7?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=20=E7=9A=84=E6=A0=B7=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=8B=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/boards_controller.rb | 8 ++-- app/views/boards/_course_new.html.erb | 2 +- app/views/boards/_course_show.html.erb | 45 +++++++++++++++---- app/views/boards/_edit.html.erb | 4 +- app/views/boards/_form_course.html.erb | 33 +++++++++++--- app/views/boards/_form_project.html.erb | 6 +-- app/views/boards/_project_show.html.erb | 55 ++++++++++++----------- app/views/boards/show.html.erb | 3 +- app/views/stores/index.html.erb | 21 ++++++++- public/javascripts/course.js | 58 ++++++++++++------------- public/javascripts/project.js | 4 ++ public/stylesheets/leftside.css | 2 +- public/stylesheets/pleft.css | 2 +- 13 files changed, 159 insertions(+), 84 deletions(-) diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 4a27f02ff..db5bded55 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -80,19 +80,19 @@ class BoardsController < ApplicationController if @project @topic_pages = Paginator.new @topic_count, per_page_option, params['page'] @topics = @board.topics. - reorder("#{Message.table_name}.sticky DESC"). + reorder("#{Message.table_name}.sticky DESC, #{Message.table_name}.created_on desc"). includes(:last_reply). limit(@topic_pages.per_page). offset(@topic_pages.offset). - order("last_replies_messages.created_on desc"). + preload(:author, {:last_reply => :author}). all elsif @course - board_topics = @board ? @board.topics.reorder("#{Message.table_name}.sticky DESC"). + board_topics = @board ? @board.topics.reorder("#{Message.table_name}.sticky DESC, #{Message.table_name}.created_on desc"). includes(:last_reply). # limit(@topic_pages.per_page). # offset(@topic_pages.offset). - order("last_replies_messages.created_on desc"). + preload(:author, {:last_reply => :author}). all : [] @topics = paginateHelper board_topics,10 diff --git a/app/views/boards/_course_new.html.erb b/app/views/boards/_course_new.html.erb index a380ad67f..aaf6d66e5 100644 --- a/app/views/boards/_course_new.html.erb +++ b/app/views/boards/_course_new.html.erb @@ -3,7 +3,7 @@ <%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %>
  • <%= l(:button_cancel) %> - <%= l(:button_submit)%> + <%= l(:button_submit)%>
  • <% end %> diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 2a078553c..766340c1b 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -16,7 +16,7 @@
    -
    +
      <%= render :partial => 'course_new' %>
    @@ -40,7 +40,7 @@

      <%= h(topic.subject) %>

    <% if topic.course_editable_by?(User.current) %> - <%= l(:button_edit) %> <% end %> @@ -59,7 +59,7 @@
    @@ -70,7 +70,7 @@
    -