无“标签”时显示“暂无标签”

This commit is contained in:
huangjingquan 2013-08-20 20:20:51 +08:00
parent 68240c6f8f
commit b100754b96
1 changed files with 32 additions and 24 deletions

View File

@ -4,34 +4,42 @@
<% if non_list_all and (@tags.size > 0) %>
<!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 -->
<% if @tags.size > Setting.show_tags_length.to_i then %>
<% i = 0 %>
<% until i>Setting.show_tags_length.to_i do %>
<div id="tag">
<% if @tags.size > Setting.show_tags_length.to_i then %>
<% i = 0 %>
<% until i>Setting.show_tags_length.to_i do %>
<div id="tag">
<%= link_to @tags[i], :controller => "tags",:action => "index",:q => @tags[i],:object_flag => object_flag,:obj_id => obj.id %>
</div>
<% i += 1%>
<% end %>
<%= link_to l(:label_more_tags),:action => "show",:id => obj.id %>
</div>
<% i += 1%>
<% end %>
<%= link_to l(:label_more_tags),:action => "show",:id => obj.id %>
<% else %>
<% @tags.each do |tag| %>
<div id="tag">
<%= link_to tag,:controller => "tags",:action => "index",:q=>tag,:object_flag => object_flag,:obj_id => obj.id %>
</div>
<% end %>
<% end %>
<% else %>
<% @tags.each do |tag| %>
<div id="tag">
<%= link_to tag,:controller => "tags",:action => "index",:q=>tag,:object_flag => object_flag,:obj_id => obj.id
%>
</div>
<% end %>
<% end %>
<% else %>
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
<div id="tag">
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
<div id="tag">
<%= link_to tag,:controller => "tags",:action => "index",:q=>tag ,:object_flag => object_flag,:obj_id => obj.id %>
</div>
<% end %>
<% end %>
</div>
<% end %>
<% else %>
<div id="tag">暂无标签!</div>
<% end %>
<% end %>