竞赛、课程首页,贴吧动态名字过长显示问题

课程、项目编辑贴子导航丢失问题
This commit is contained in:
z9hang 2014-07-28 15:06:54 +08:00
parent 9bf8abd03b
commit 90a35fa24a
4 changed files with 18 additions and 5 deletions

View File

@ -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,9 +107,17 @@ 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
def destroy
(render_403; return false) unless @message.destroyable_by?(User.current)

View File

@ -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%>
<!DOCTYPE html>
<html lang="en">
<head>

View File

@ -275,10 +275,10 @@
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
</span>
<span class="memo_author">
<%=l(:label_question_sponsor)%>:&nbsp;<%= link_to_user(topic.author) %>
<%=l(:label_question_sponsor)%>:&nbsp;<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person">
<%=l(:label_final_reply)%>:&nbsp;<%=link_to_user topic.last_reply.try(:author) %>
<%=l(:label_final_reply)%>:&nbsp;<% 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 %>
</span>
<span class="memo_reply">
<%=l(:label_reply)%>(<%= link_to topic.try(:replies_count), topic.event_url %>)

View File

@ -243,10 +243,10 @@
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
</span>
<span class="memo_author">
楼主: <%= link_to_user(topic.author) %>
楼主: <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person">
最后回复:<%= 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 %>
</span>
<span class="memo_reply">
回复(<%= link_to topic.try(:replies_count), topic.event_url %>)