diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index a6b05ea2b..006a2c3d3 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -208,8 +208,8 @@ class ForumsController < ApplicationController reorder(order). preload(:author, {:last_reply => :author}). all - @my_topic_count = Memo.where("author_id = #{User.current.id} and parent_id is null").count - @my_replies_count = Memo.where("author_id = #{User.current.id} and parent_id is not null").count + @my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is null").count + @my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is not null").count @errors = params[:errors] # 推荐贴吧 @forums = Forum.where("id !=?", @forum.id).reorder("topic_count desc,updated_at desc").first(3) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 02224063a..680f36b45 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -29,8 +29,6 @@ <% end %> - -
时间
人气
diff --git a/app/views/forums/show.js.erb b/app/views/forums/show.js.erb index 48b1474cb..a832b67d9 100644 --- a/app/views/forums/show.js.erb +++ b/app/views/forums/show.js.erb @@ -1 +1 @@ -$("#topics_list").html("<%= escape_javascript(render :partial => 'show_topics',:locals => {:memos=>@memos})%>") +$("#topics_list").html("<%= escape_javascript(render :partial => 'show_topics',:locals => {:memos=>@memos}) %>") diff --git a/app/views/memos/_my_count_message.html.erb b/app/views/memos/_my_count_message.html.erb index e8fab19eb..76269366d 100644 --- a/app/views/memos/_my_count_message.html.erb +++ b/app/views/memos/_my_count_message.html.erb @@ -1,16 +1,46 @@ -
-
<%= link_to image_tag(url_to_avatar(User.current), :width => 50, :height => 50,:alt=>'贴吧图像' ), user_path( User.current) %>
-
-
我在贴吧
-
-
<%= @my_replies_count %>
-
回答
+
+
+
<%= link_to image_tag(url_to_avatar(@forum.creator),:width=>75,:height => 75,:alt=>'贴吧图像' ), user_path( @forum.creator) %> +
-
-
- -
发帖
+
+ <%= link_to @forum.name, forum_path(@forum), :class => "f16 fontBlue", :style => "word-break: break-all; word-wrap:break-word;white-space:pre-wrap;" %> + <% user_name = @forum.creator.show_name.empty? ? @forum.creator.name : @forum.creator.show_name %> + +
+
+
<%= @forum.description.html_safe%> + <%if @forum.creator.id == User.current.id%> + + <%= image_tag('signature_edit.png',{:width=>12,:height=>12}) %> + + <%end%> +
+
+
+ <%= render :partial => 'forums/forum_tag_list', :locals => {:forum => @forum} %> +
+ <% if(@forum.creator.id == User.current.id)%> + + 添加标签 + <% end %> +
+
+ <% if @forum.creator.id == User.current.id %> + + + 编辑贴吧 + 删除贴吧 + + + <% end %>
-
-
+ +
+ <%= link_to "我要提问".html_safe, new_forum_memo_path(:forum_id => @forum) %> +
+ +
\ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index de7ce4294..0aaef10fc 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -100,52 +100,8 @@
-
-
-
<%= link_to image_tag(url_to_avatar(@forum.creator),:width=>75,:height => 75,:alt=>'贴吧图像' ),user_path( @forum.creator) %> - -
-
- <%= link_to @forum.name, forum_path(@forum), :class => "f16 fontBlue", :style => "word-break: break-all; word-wrap:break-word;white-space:pre-wrap;" %> - <% user_name = @forum.creator.show_name.empty? ? @forum.creator.name : @forum.creator.show_name %> - - -
-
-
<%= @forum.description.html_safe%> - <%if @forum.creator.id == User.current.id%> - - <%= image_tag('signature_edit.png',{:width=>12,:height=>12})%> - - <%end%> -
-
-
- <%= render :partial=>'forums/forum_tag_list',:locals=>{:forum=>@forum}%> -
- <% if(@forum.creator.id == User.current.id)%> - + 添加标签 - <% end %> -
-
- <%if @forum.creator.id == User.current.id%> - - - 编辑贴吧 - 删除贴吧 - - - <% end %> -
+<%= render :partial => "memos/my_count_message" %> -
- <%= link_to "我要提问".html_safe, new_forum_memo_path(:forum_id => @forum) %> -
- -