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

exceptionHandle
huangjingquan 12 years ago
parent 68240c6f8f
commit b100754b96

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