- <%= link_to image_tag(url_to_avatar(@user), :class => 'avatar2'), :class => "avatar" %> |
+ <%= image_tag(url_to_avatar(news.author), :class => "avatar") %> |
- <%=link_to news.author%> 分享了 <%= link_to h(news.title), news_path(news) %> |
+ <%=link_to_user(news.author)if news.respond_to?(:author) %> 分享了 <%= link_to h(news.title), news_path(news) %> |
<%= textilizable(news, :description) %> |
<%= news.created_on %> |
- <%= link_to"查看其他评论",news_path(news)%><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %> |
+ <%= link_to"查看其他评论",news_path(news)%><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %> |
|
diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb
index a73447a8..f8aa8571 100644
--- a/app/views/news/show.html.erb
+++ b/app/views/news/show.html.erb
@@ -22,32 +22,7 @@
<%= l(:label_comment_plural) %>
+<% @comments.each do |comment| %> + <% next if comment.new_record? %> +<%= textilizable(comment.comments) %>
<%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %>
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index fbc30bd0..22d337d5 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -184,6 +184,14 @@ ul.tool li{list-style-type:none; background-color:#03a7dd; overflow:hidden } +.user_underline2{ + margin:1; + padding:1; + width:240px; + height:2px; + background-color:#ebebeb; + overflow:hidden +} .line_under{ border-bottom: 1px dashed rgb(204, 204, 204); }