cache test

This commit is contained in:
yanxd 2014-06-12 15:20:14 +08:00
parent e4ed8cf970
commit 09edfc7c0c
1 changed files with 14 additions and 4 deletions

View File

@ -52,7 +52,9 @@
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span> <span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% find_miracle_project(10, 3).map do |project| %> <% projects = find_miracle_project(10, 3) %>
<% cache projects do %>
<% projects.map do |project| %>
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'> <li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
<div style="float: left;"> <div style="float: left;">
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %> <%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
@ -71,11 +73,11 @@
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
:class => "tooltip", :class => "tooltip",
:id => "tooltip-#{project.id}" %> :id => "tooltip-#{project.id}" %>
</p>
</div> </div>
</li> </li>
<% end; reset_cycle %> <% end; reset_cycle %>
</ul> </ul>
<% end %>
</div> </div>
</div> </div>
@ -84,7 +86,9 @@
<h3 style="color: rgb(21, 188, 207)"><strong>用户动态</strong></h3> <h3 style="color: rgb(21, 188, 207)"><strong>用户动态</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span> <span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
<div class="user-message-box-list" style="margin-top: 10px;"> <div class="user-message-box-list" style="margin-top: 10px;">
<% find_all_activities.each do |event| %> <%activities = find_all_activities%>
<% cache activities do %>
<% activities.each do |event| %>
<li style="display: block;height:60px; padding-bottom: 4px;"> <li style="display: block;height:60px; padding-bottom: 4px;">
<div class="inner-right" style="float: left; height: 100%; "> <div class="inner-right" style="float: left; height: 100%; ">
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %> <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
@ -96,12 +100,14 @@
</div> </div>
</li> </li>
<% end %> <% end %>
<% end %><!-- cache -->
</div> </div>
</ul> </ul>
</div> </div>
<div class="right" style="float: right; width: 48%; "> <div class="right" style="float: right; width: 48%; ">
<ul class="welcome-message-list"> <ul class="welcome-message-list">
<% cache 'forum_links' do %>
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;"> <div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
<h3 style="color: rgb(21, 188, 207);"> <h3 style="color: rgb(21, 188, 207);">
<strong>贴吧动态</strong> <strong>贴吧动态</strong>
@ -109,8 +115,11 @@
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%></h3> <%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%></h3>
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span> <span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
</div> </div>
<% end %>
<div class="welcome-box-list-new memo_activity"> <div class="welcome-box-list-new memo_activity">
<% find_new_forum_topics(7).each do |topic|%> <% topics = find_new_forum_topics(7) %>
<% cache topics do %>
<% topics.each do |topic|%>
<li class="message-brief-intro"> <li class="message-brief-intro">
<div class='memo_title text_nowrap'> <div class='memo_title text_nowrap'>
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %> <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
@ -131,6 +140,7 @@
</div> </div>
</li> </li>
<% end %> <% end %>
<% end %> <!-- cache -->
</div> </div>
</ul> </ul>
</div> </div>