<% else %>
<ul>
<% for election in @current_elections %>
- <li><%= link_to election.name, :controller => 'election', :action => 'show', :id => election.id %> (ends in <em><%=
- distance_of_time_in_words Time.now, election.enddate %></em>)</li>
+ <li><%= link_to election.name, :controller => 'election', :action => 'show', :id => election.id %>
+ <% if Time.now > election.enddate %>
+ (election over)
+ <% else %>
+ (ends in <em><%= distance_of_time_in_words Time.now, election.enddate %></em>)</li>
+ <% end %>
<% end %>
</ul>
<% end %>
+<p><%= link_to "Create a new election", :controller => 'election', :action => 'new' %>.</p>
+