From fe2f6a0d9d61df25ea798739a10ea0a58484e25d Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 13 May 2015 14:31:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E6=B7=BB=E5=8A=A0=E5=9B=9E=E5=A4=8D=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=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 | 18 +++++++++++++----- app/views/attachments/_form_course.html.erb | 2 +- app/views/attachments/_form_project.html.erb | 2 +- app/views/boards/_project_show.html.erb | 17 ++++++++++------- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 6e2da4bb0..619f91245 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -194,11 +194,19 @@ class MessagesController < ApplicationController redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)) end elsif request.get? - respond_to do |format| - format.html { - layout_file = @project ? 'base_projects' : 'base_courses' - render :layout => layout_file - } + if params[:is_board] + if @project + redirect_to project_boards_path(@project) + elsif @course + redirect_to course_boards_path(@course) + end + else + respond_to do |format| + format.html { + layout_file = @project ? 'base_projects' : 'base_courses' + render :layout => layout_file + } + end end end end diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index 7b07426aa..4a297fb7b 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -56,7 +56,7 @@ :file_count => l(:label_file_count), :delete_all_files => l(:text_are_you_sure_all) } %> -<%= l(:label_no_file_uploaded)%> +<%= l(:label_no_file_uploaded)%> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) diff --git a/app/views/attachments/_form_project.html.erb b/app/views/attachments/_form_project.html.erb index 66d9a0e80..a3d30bd45 100644 --- a/app/views/attachments/_form_project.html.erb +++ b/app/views/attachments/_form_project.html.erb @@ -56,7 +56,7 @@ :file_count => l(:label_file_count), :delete_all_files => l(:text_are_you_sure_all) } %> - <%= l(:label_no_file_uploaded)%> + <%= l(:label_no_file_uploaded)%> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 150acbabd..a20bed3fd 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -40,12 +40,10 @@
<%= h(topic.subject) %>
<% if topic.editable_by?(User.current) %> - <%= l(:button_edit) %> - <% end %> - <% if topic.sticky? %> - <%= l(:label_board_sticky)%> + <%= l(:button_edit) %> <% end %> + <%= link_to( l(:button_delete), {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, @@ -55,7 +53,9 @@ :style => ' margin-right: 10px;' ) if topic.destroyable_by?(User.current) %> - + <% if topic.sticky? %> + <%= l(:label_board_sticky)%> + <% end %>@@ -96,7 +96,10 @@ <%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %> - <%= l(:label_memo_create)%> + <%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %> + <%= l(:label_memo_create)%> + + <% end %>