diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index e974936eb..438dd0aaf 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -18,7 +18,7 @@ class MessagesController < ApplicationController menu_item :boards default_search_scope :messages - before_filter :find_board, :only => [:new, :preview] + before_filter :find_board, :only => [:new, :preview,:edit] before_filter :find_attachments, :only => [:preview] before_filter :find_message, :except => [:new, :preview] before_filter :authorize, :except => [:preview, :edit, :destroy, :new] @@ -107,7 +107,15 @@ class MessagesController < ApplicationController flash[:notice] = l(:notice_successful_update) @message.reload redirect_to board_message_path(@message.board, @message.root, :r => (@message.parent_id && @message.id)) + elsif request.get? + respond_to do |format| + format.html { + layout_file = @project ? 'base_projects' : 'base_courses' + render :layout => layout_file + } + end end + end # Delete a messages diff --git a/app/views/layouts/base_tags.html.erb b/app/views/layouts/base_tags.html.erb index d7f53a641..6a5b490d1 100644 --- a/app/views/layouts/base_tags.html.erb +++ b/app/views/layouts/base_tags.html.erb @@ -1,3 +1,8 @@ +<% @nav_dispaly_home_path_label = 1 + @nav_dispaly_main_course_label = 1 + @nav_dispaly_main_project_label = 1 + @nav_dispaly_main_contest_label = 1 %> +<% @nav_dispaly_forum_label = 1%>
diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 10da9f331..27afed749 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -275,10 +275,10 @@ <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> - <%=l(:label_final_reply)%>: <%=link_to_user topic.last_reply.try(:author) %> + <%=l(:label_final_reply)%>: <% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %> <%=l(:label_reply)%>(<%= link_to topic.try(:replies_count), topic.event_url %>) diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index dae00f50e..5c2b82e2a 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -243,10 +243,10 @@ <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> - 最后回复:<%= link_to_user topic.last_reply.try(:author) %> + 最后回复:<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %> 回复(<%= link_to topic.try(:replies_count), topic.event_url %>)