Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 34 lines (33 sloc) 1.34 KB
<%
# read view_count from model cache if model has been cached.
view_count = blog.view_count
if b = Blog.read_second_level_cache(blog.id)
view_count = b.view_count
end
%>
<div class="con">
<div class="tit clearfix">
<%= link_to blog.title, blog_url(blog) %>
<% if account_admin? %>
<%= link_to '', url(:admin, :blog, :id => blog.id), :method => :delete, :confirm => '你要删除这篇文章吗?', :class => 'del', :title => '删除' %>
<%= link_to '', url(:admin, :edit_blog, :id => blog.id), :class => 'edit', :title => '编辑' %>
<% end %>
</div>
<div class="text">
<div class="infor_tag">
<% blog.cached_tags.each do |tag| %>
<%= link_to "<span>#{tag}</span>".html_safe, url(:blog, :tag, :name => tag), :class => 'tag', :rel => 'tag' %>
<% end %>
</div>
<%= blog.content.truncate(300) %>
</div>
<div class="info clearfix">
<div class="fr">
<span class="author"><%= blog.account.name %></span>
<span class="time"><%= time_ago_in_words(blog.created_at) %>发表</span>
<span class="edit"><%= time_ago_in_words(blog.content_updated_at) %>更新</span>
<span class="views" title="浏览次数"><%= view_count %>次浏览</span>
<%= link_to blog.comments_count.to_s, blog_url(blog), :anchor => 'comments', :class => 'comment', :title => '评论' %>
</div>
</div>
</div>
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.