Skip to content

Commit

Permalink
Rails 3-ified and cleaned up some templates that were blowing up
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Neufeld committed Nov 25, 2010
1 parent e482d42 commit dbff09f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions lib/vanity/templates/_experiment.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<h3><%=vanity_h experiment.name %> <span class="type">(<%= experiment.class.friendly_name %>)</span></h3>
<%= experiment.description.to_s.split(/\n\s*\n/).map { |para| vanity_html_safe(%{<p class="description">#{vanity_h para}</p>}) }.join %>
<%= render Vanity.template(experiment.type), :experiment=>experiment %>
<h3>
<%=vanity_h experiment.name %>
<span class="type">(<%= experiment.class.friendly_name %>)</span>
</h3>
<%- experiment.description.to_s.split(/\n\s*\n/).each do |para| %>
<p class="description"><%= vanity_h para %></p>
<%- end %>
<%= render :file => Vanity.template("_#{experiment.type}"), :locals => { :experiment=>experiment } %>
<p class="meta">Started <%= experiment.created_at.strftime("%a, %b %d") %>
<%= " | Completed #{experiment.completed_at.strftime("%a, %b %d")}" unless experiment.active? %></p>
2 changes: 1 addition & 1 deletion lib/vanity/templates/_experiments.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ul class="experiments">
<% experiments.sort_by { |id, experiment| experiment.created_at }.reverse.each do |id, experiment| %>
<li class="experiment <%= experiment.type %>" id="experiment_<%=vanity_h id.to_s %>">
<%= render Vanity.template("experiment"), :id=>id, :experiment=>experiment %>
<%= render :file => Vanity.template("_experiment"), :locals => {:id=>id, :experiment=>experiment} %>
</li>
<% end %>
</ul>

0 comments on commit dbff09f

Please sign in to comment.