From c18d1d9585793c60df7babe98cc35eacf1786742 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 22 May 2015 11:09:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E5=8C=BF=E5=90=8D?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=96=B0=E5=B8=96=E3=80=8B=E3=80=8A=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=97=B6=E5=87=BA=E7=8E=B0=E8=B7=B3=E8=BD=AC=E9=94=99?= =?UTF-8?q?=E8=AF=AF=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/messages_controller.rb | 2 +- app/views/boards/_course_show.html.erb | 72 ++++++++++++++++++++----- app/views/boards/_edit.html.erb | 4 +- app/views/boards/_form_course.html.erb | 2 +- app/views/boards/_form_project.html.erb | 2 +- app/views/boards/_project_show.html.erb | 31 ++++++----- public/javascripts/course.js | 2 + 7 files changed, 85 insertions(+), 30 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 619f91245..e33eb8d75 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -193,7 +193,7 @@ class MessagesController < ApplicationController else redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)) end - elsif request.get? + elsif request.get? || request.post? if params[:is_board] if @project redirect_to project_boards_path(@project) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 766340c1b..cf3cd6ec5 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -10,7 +10,9 @@ <% end %> - <%= l(:label_message_new) %> + <% if User.current.logged? %> + <%= l(:label_message_new) %> + <% end %>
@@ -40,7 +42,7 @@

  <%= h(topic.subject) %>

<% if topic.course_editable_by?(User.current) %> - <%= l(:button_edit) %> <% end %> @@ -70,7 +72,7 @@
@@ -98,11 +102,11 @@
@@ -139,6 +143,15 @@ :title => l(:button_delete), :class => ' c_dblue fr' ) if message.course_destroyable_by?(User.current) %> + <%= link_to( + l(:button_reply), + {:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id, :is_board => 'true'}, + :remote => true, + :method => 'get', + :focus => "about_newtalk#{topic.id}", + :class => ' c_dblue fr', + :style => 'margin-right: 10px;', + :title => l(:button_quote)) if !topic.locked? && authorize_for('messages', 'reply') %>
@@ -168,6 +181,15 @@ :title => l(:button_delete), :class => ' c_dblue fr' ) if message.course_destroyable_by?(User.current) %> + <%= link_to( + l(:button_reply), + {:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id, :is_board => 'true'}, + :remote => true, + :method => 'get', + :focus => "about_newtalk#{topic.id}", + :class => ' c_dblue fr', + :style => 'margin-right: 10px;', + :title => l(:button_quote)) if !topic.locked? && authorize_for('messages', 'reply') %>
@@ -176,7 +198,7 @@ <%if replies_all.first %> -
展开回复(<%= topic.replies_count.to_s%>)
+
展开回复(<%= topic.replies_count.to_s%>)
<% end %> <% end %> @@ -196,6 +218,7 @@ <% content_for :header_tags do %> <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@course}: #{@board}") %> <% end %> +