Commits

Anonymous committed 7d37a01

tags

Comments (0)

Files changed (7)

views/common/_tag_cloud.erb

-
-          <div class="tagsblock">
-            <h3>标签</h3>
-            <a href="/tags/%E4%BC%A4%E4%B8%8D%E8%B5%B7" rel="tag">伤不起</a>
-            <a href="/tags/JJ" rel="tag">JJ</a>
-            <a href="/tags/%E6%A0%A1%E5%9B%AD" rel="tag">校园</a>
-            <a href="/tags/%E5%9B%B4%E8%A7%82" rel="tag">围观</a>
-            <a href="/tags/ML" rel="tag">ML</a>
-            <a href="/tags/%E7%BE%8E%E5%A5%B3" rel="tag">美女</a>
-            <a href="/tags/%E8%BD%A6%E9%9C%87" rel="tag">车震</a>
-            <a href="/tags/%E7%81%AB%E6%98%9F%E6%96%87" rel="tag">火星文</a>
-            <a href="/tags/%E9%9D%9E%E4%B8%BB%E6%B5%81" rel="tag">非主流</a>
-            <a href="/tags/%E4%B8%80%E5%8F%A5%E8%AF%9D%E4%B8%8D%E5%89%B2" rel="tag">一句话不割</a>
-            <a href="/tags/%E7%A9%BF%E8%B6%8A" rel="tag">穿越</a>
-            <a href="/tags/%E6%89%93%E9%A3%9E%E6%9C%BA" rel="tag">打飞机</a>
-            <a href="/tags/%E7%A7%92%E6%9D%80" rel="tag">秒杀</a>
-            <a href="/tags/%E8%90%9D%E8%8E%89" rel="tag">萝莉</a>
-            <a href="/tags/hold" rel="tag">hold</a>
-            <a href="/tags/%E8%85%90%E5%A5%B3" rel="tag">腐女</a>
-            <a href="/tags/%E5%B0%8F%E4%B8%89" rel="tag">小三</a>
-            <a href="/tags/TT" rel="tag">TT</a>
-            <a href="/tags/%E5%BE%A1%E5%A7%90" rel="tag">御姐</a>
-            <!--a href="/tags/%E8%90%8C" rel="tag">萌</a-->
-            <a href="/tags/mm" rel="tag">mm</a>
-            <a href="/tags/%E4%BA%8C%E5%A5%B6" rel="tag">二奶</a>
-            <a href="/tags/%E6%AD%A3%E5%A4%AA" rel="tag">正太</a>
-            <a href="/tags/%E4%BD%A0%E6%87%82%E7%9A%84" rel="tag">你懂的</a>
-            <a href="http://app.qiushibaike.com" title="下载糗百客户端">客户端</a>
-            <a href="http://erji.hao123.com/xiaoqingxin">hao123小清新</a>
-            <a href="/tags">更多...</a>
-          </div>
-          <div class="shadow"></div>
+<div class="tagsblock">
+  <h3>标签</h3>
+  <% cache 'sidebar_tag_cloud', :expires_in => 12.hour do %>
+    <% tags = Article.tag_counts#@group.public_articles.cached_tag_clouds %>
+    <% tags.each do |tag| %>
+      <%= link_to tag.name, group_tag_path(@group, tag), :rel => 'tag' %>
+    <% end %>
+  <% end %>
+  <%= link_to '更多...', group_tags_path(@group) %>
+</div>
+<div class="shadow"></div>

views/groups/showjs.erb

-document.write("<%= @article.content.gsub(/['"\\\n\r<>&]/) do
-  { '"' => '\"',
-    "'" => "\\'",
-    "\\" => "\\\\",
-    "\n" => '\n',
-    "\r" => '\r',
-    '<' => '&lt;',
-    '>' => '&gt;',
-    '&' => '&amp;'}[$&]
-end
-%><%=@extra%>");
-document.write(" <a href='http://zuikeai.net<%=article_path(@article)%>' target='_blank'>帖子#<%= @article.id %></a> ");
-document.write(" <a href='http://zuikeai.net/articles/voteup/<%=@article.id%>' target='_blank'><img border='0' src='http://zuikeai.net/images/qiushi/good.gif' alt='頂' border='0'></a>(+ <%= @article.pos_score %>, - <%= -  @article.neg_score %>) <a href='http://zuikeai.net/articles/votedown/<%=@article.id%>' target='_blank'><img src='http://zuikeai.net/images/qiushi/bad.gif' alt='拍' border='0'></a>");

views/groups/tags.html.erb

-<% content_for :title, '帖子的标签云' %>
-<% cache 'tag_cloud', :expires_in => 12.hour do %>
-<% @tags = @group.public_articles.cached_tag_clouds %>
-<div id="tagcloud">
-    <% if ( @msg || flash[:notice] ) %>
-        <div id="notice"> <%= ( @msg || flash[:notice] ) %> </div>
-    <% end %>
-  <% tag_cloud @tags, %w(4 3 2 2 2 1 1 1 1 1) do |tag, css_class| %>
-      <span class="tag_level<%= css_class %>"><%= link_to tag.name, { :action => :tag, :tag => tag.name }, :rel => 'tag' %></span>
-  <% end %>
-    <%# @tags.each do |t|
-        cnt = t.cnt.to_i
-        _erbout << "<span class='tag_level" +
-                 if cnt<@tag_max[0]; "4"; elsif cnt<@tag_max[1]; "3"
-                                elsif cnt<@tag_max[2]; "2"; else; "1"; end + "'>" +
-                 link_to( t.name, :controller => :qiushi, :action =>:tag, :id =>t.name ) +
-                 "</span>\n"
-    end %>
-</div>
-<% end %>

views/groups/tags.mobile.erb

-<% cache 'tag_cloud', :expires_in => 12.hour do %>
-  
-<%
-  @content_for_title = '帖子的标签云'
-  @tags = @group.public_articles.cached_tag_clouds
-%>
-<div id="tagcloud">
-    <% if ( @msg || flash[:notice] ) %>
-        <div id="notice"> <%= ( @msg || flash[:notice] ) %> </div>
-    <% end %>
-  <% tag_cloud @tags, %w(4 3 2 2 2 1 1 1 1 1) do |tag, css_class| %>
-      <span class="tag_level<%= css_class %>"><%= link_to tag.name, { :action => :tag, :tag => tag.name }, :rel => 'tag' %></span>
-  <% end %>
-    <%# @tags.each do |t|
-        cnt = t.cnt.to_i
-        _erbout << "<span class='tag_level" +
-                 if cnt<@tag_max[0]; "4"; elsif cnt<@tag_max[1]; "3"
-                                elsif cnt<@tag_max[2]; "2"; else; "1"; end + "'>" +
-                 link_to( t.name, :controller => :qiushi, :action =>:tag, :id =>t.name ) +
-                 "</span>\n"
-    end %>
-</div>
-<% end %>

views/layouts/application.html.erb

         <h1>创建账号</h1>
         <div class="intro">
           请珍惜自己的账号,一旦作恶,账号将被永久删除。<br/><br/>
-          <!--使用糗百 <a href="http://itunes.apple.com/cn/app/id422853458?ls=1&amp;mt=8" target="_blank">iPhone</a> 或 <a href="http://www.wandoujia.com/apps/qsbk.app" target="_blank">Android</a> 应用可以无码快速注册,尽享移动欢乐!</div>-->
-          <%= link_to '注册', signup_path, :class => 'button' %>
+          <!--使用糗百 <a href="http://itunes.apple.com/cn/app/id422853458?ls=1&amp;mt=8" target="_blank">iPhone</a> 或 <a href="http://www.wandoujia.com/apps/qsbk.app" target="_blank">Android</a> 应用可以无码快速注册,尽享移动欢乐!-->
+        </div>
+        <%= link_to '注册', signup_path, :class => 'button' %>
       </div>
     </div>
     <div id="suggest-form">
     <%= theme_javascript_include_tag %w(jquery.bgiframe.min.js lightbox_me fancybox
               cookie cursor base64 poshytip
               lib2nd vote_history vote floorlink comment
-              ajaxlogin app) %>
+              ajaxlogin app), :cache => true %>
     <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>
     <% if @group 
       j = @group.as_json(:only => [:id, :name, :description])

views/layouts/sessions.html.erb

     <%= theme_javascript_include_tag %w(jquery.bgiframe.min.js lightbox_me fancybox
               cookie cursor base64 poshytip
               lib2nd vote_history vote floorlink comment
-              ajaxlogin app) %>
+              ajaxlogin app), :cache => true %>
     <%= theme_javascript_include_tag 'jquery.placeholder.min.js', 'signin_up' %>    
     <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>    
 <script>

views/tags/index.html.erb

-<% if @tags.size > 0 %>
-  <% @tags.each do |tag| %>
-    <li><%= link_to tag.name, [@group, @tag] %></li>
-  <% end %>  
-<% else %>
-  目前还没有任何标签
+<% content_for :title, '帖子的标签云' %>
+<% cache 'tag_cloud', :expires_in => 12.hour do %>
+<% @tags = @group.public_articles.cached_tag_clouds %>
+<div id="tagcloud">
+  <% if ( @msg || flash[:notice] ) %>
+      <div id="notice"> <%= ( @msg || flash[:notice] ) %> </div>
+  <% end %>
+  <% tag_cloud @tags, %w(4 3 2 2 2 1 1 1 1 1) do |tag, css_class| %>
+      <span class="tag_level<%= css_class %>"><%= link_to tag.name, { :action => :tag, :tag => tag.name }, :rel => 'tag' %></span>
+  <% end %>
+</div>
 <% end %>