Skip to content

Commit

Permalink
Reused timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
aitor committed Apr 18, 2010
1 parent f7e4842 commit c1cfdfc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 31 deletions.
29 changes: 9 additions & 20 deletions app/views/municipios/evolution.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,9 @@
<%= link_to @muni.nombre, city_card_path(@muni) %>
<% end %>

<h2><%= @muni.province_name %></h2>
<h2><%= @muni.nombre %></h2>

<hr/>
<% (1985..2009).each do |year| %>
<%= link_to year, city_card_by_year_path(@muni, year) %>
<% end %>
<hr/>
<%= @muni.codigo_ine %>
<%= @muni.nombre %>

<hr/>
<%= render :partial => 'shared/timeline', :locals => { :muni => @muni } %>

<script type="text/javascript" charset="utf-8">
var states = [1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009];
Expand Down Expand Up @@ -95,15 +87,12 @@
<h2>Población</h2>
<div id="holder_evolution_population"></div>



<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<hr/>

<%#
<ul>
<% munis = Municipio.find_all_by_provincia(@muni.provincia) %>
<%= munis.size %> municipios here
<% for muni in munis %>
<li><%= link_to muni.nombre, city_card_path(muni) %></li>
<% end %>
< munis = Municipio.find_all_by_provincia(@muni.provincia) >
< munis.size > municipios here
< for muni in munis >
<li>< link_to muni.nombre, city_card_path(muni) ></li>
< end >
</ul>
%>
12 changes: 1 addition & 11 deletions app/views/municipios/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
<%= link_to @muni.nombre, city_card_path(@muni) %> EN <%= @year %>
<% end %>

<!-- timeline -->
<div class="timeline">
<p class="years_nav years_prev" id="mycarousel-prev"><a href="#">&larr; años anteriores</a></p>
<p class="years_nav years_next" id="mycarousel-next"><a href="#">años siguientes &rarr;</a></p>
<ul id="budget_timeline" class="timeline_years">
<% (1985..2009).each do |year| %>
<li <%= (year == @year) ? "class='actual_year'": '' %>><%= link_to year, city_card_by_year_path(@muni, year) %></li>
<% end %>
</ul>
</div>
<!-- /timeline -->
<%= render :partial => 'shared/timeline', :locals => { :muni => @muni } %>

<p class="show_evolution"><%= link_to "&larr; Evolución &rarr;", city_evolution_path(@muni), :class=>"btn" %></p>

Expand Down
11 changes: 11 additions & 0 deletions app/views/shared/_timeline.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- timeline -->
<div class="timeline">
<p class="years_nav years_prev" id="mycarousel-prev"><a href="#">&larr; años anteriores</a></p>
<p class="years_nav years_next" id="mycarousel-next"><a href="#">años siguientes &rarr;</a></p>
<ul id="budget_timeline" class="timeline_years">
<% (1985..2009).each do |year| %>
<li <%= (year == @year) ? "class='actual_year'": '' %>><%= link_to year, city_card_by_year_path(muni, year) %></li>
<% end %>
</ul>
</div>
<!-- /timeline -->

0 comments on commit c1cfdfc

Please sign in to comment.