Created
November 1, 2012 05:26
-
-
Save rbirnie/3992011 to your computer and use it in GitHub Desktop.
Show page with Partials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% list = @hosts.nil? ? @trend : @hosts %> | |
<% list.values.includes(:trendable).in_groups(4, false) do |group| %> | |
<div class="span3"> | |
<td> | |
<% group.each do |host| -%> | |
<ul class="base"> | |
<li> | |
<% opts = host.name? ? host.name : host.fact_value %> | |
<%= link_to(opts, host_path(:id => opts), :title => "Show Host") %> | |
</li> | |
</ul> | |
<% end %> | |
</td> | |
</div> | |
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% list = @hosts.nil? ? @trend : @hosts %> | |
<% list.values.includes(:trendable).in_groups(4, false) do |group| %> | |
<div class="span3"> | |
<td> | |
<% group.each do |host| -%> | |
<ul class="base"> | |
<li> | |
<%= link_to(host.host, host_path(:host_id => host.host), :title => "Show Host") %> | |
</li> | |
</ul> | |
<% end %> | |
</td> | |
</div> | |
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% list = @hosts.nil? ? @trend : @hosts %> | |
<% list.values.includes(:trendable).in_groups(4, false) do |group| %> | |
<div class="span3"> | |
<td> | |
<% group.each do |trend| -%> | |
<ul class="base"> | |
<li> | |
<% opts = trend.name? ? trend.name : trend.fact_value %> | |
<table class="table table-condensed table-layout: fixed"> | |
<tr> | |
<td style="width: 80%; border-top: none" > | |
<%= link_to opts, trend_path(:id => trend.id, :search => "facts.#{trend.fact_name} = \"#{trend.fact_value}\""), :title => "Trend Details" %> | |
</td> | |
<td style="width: 20%; border-top: none"> | |
<%= trend.trend_counters.last.count %> | |
</td> | |
</tr> | |
</table> | |
</li> | |
</ul> | |
<% end %> | |
</td> | |
</div> | |
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% title "Trends for #{trend_title(@trend)}" %> | |
<% content_for(:search_bar) { trend_days_filter } %> | |
<%= trend_chart 'trend_graph', "#{trend_title(@trend)}", "last #{range} days", chart_data(@trend, range.days.ago) %> | |
<table class="table"> | |
<% head = @hosts ? "Hosts" : "Values" %> | |
<th colspan="4"><%= head %></th> | |
<tr> | |
<% if @hosts && @trend.first.is_a?(FactTrend) %> | |
<%= render fact_hosts %> | |
<% elsif @hosts %> | |
<%= render foreman_hosts %> | |
<% else %> | |
<%= render trends %> | |
<% end %> | |
</tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment