avatar

31

view improvements

by chrisk, 19 Jun, 2007 07:13 PM
16 31  
1313   <label><%= form.check_box :use_duration %> use duration</label><br />
1414   <label><%= form.check_box :use_weight %> use weight</label><br />
1515   <label><%= form.check_box :use_distance %> use distance</label>
16 </p>
17 
18 <p>
19   <label><%= form.check_box :double_weight %> two-handed; double weight stats</label>
1620 </p>
22 31  
88 
99 <table>
1010 <% cur_date = nil %>
11 <% total_weight = 0 %>
1112 
1213 <% @activity.exercises.each do |exercise| %>
1314 
14   <% if cur_date != exercise.created_at.to_date %>
15   <% if cur_date != exercise.created_at.to_date.to_s(:long) %>
16   
17     <% unless cur_date.nil? %>
18       <tr><td><small>Total weight lifted: <%= total_weight %> lbs.</small></td></tr>
19     <% end %>
20     <% total_weight = 0 %>
21   
1522     <tr><td colspan="4" style="padding-top: 1em">
16       <strong><%= cur_date = exercise.created_at.to_date %></strong>
23       <strong><%= cur_date = exercise.created_at.to_date.to_s(:long) %></strong>
1724     </td></tr>
1825   <% end %>
19 
20   <tr>
21     <td><%= link_to "Set #{exercise.id}:", exercise_path(exercise.activity, exercise) %></td>
2226   
23     <td style="padding-right: 3em">
24       <% if @activity.use_reps? && @activity.use_weight? %>
25         <%= exercise.reps.to_s + ' ' + @activity.noun %> @ <%= exercise.weight %> lbs
26       <% end %>
27     </td>
27   <% total_weight += exercise.total_weight %>
2828   
29     <td><%= link_to 'edit', edit_exercise_path(@activity, exercise) %> <%= link_to 'dup', {:controller => 'exercises', :action => 'new', :activity_id => @activity, :id => exercise} %></td>
30     <td><%= link_to 'remove', exercise_path(@activity, exercise), :confirm => 'Are you sure?', :method => :delete %></td>
31   </tr>
29 
30   <%= render :partial => 'exercises/exercise', :object => exercise %>
31 
3232 <% end %>
33 
34   <tr><td><small>Total weight lifted: <%= total_weight %> lbs.</small></td></tr>
35     
3336 </table>
3437 
20 31  
2929 
3030 <p>
3131   <label for="exercise_created_at">Date:</label>
32   <%= form.datetime_select :created_at %> UTC
32   <%= form.text_field :created_at_string %>
3333 </p>
20 31  
66 
77 
88 <% if @exercise.activity.use_reps? %>
9   <p><%= @exercise.activity.noun %>: <%= @exercise.reps %></p>
9   <p><%= @exercise.activity.noun.capitalize %>: <%= @exercise.reps %></p>
1010 <% end %>
1111 
1212 <% if @exercise.activity.use_weight? %>
------
2121   <p>Distance: <%= @exercise.reps %> km</p>
2222 <% end %>
2323 
24 <% if @exercise.activity.use_reps? && @exercise.activity.use_weight? %>
25   <p>Total lifted: <%= @exercise.total_weight %> lbs.</p>
26 <% end %>
27 
2428 <p>Date: <%= @exercise.created_at.to_s(:long) %> UTC</p>
2529 
2630 
16 31  
1212   font-size: 11px;
1313 }
1414 
15 a { color: #000; }
16 a:visited { color: #666; }
17 a:hover { color: #fff; background-color:#000; }
15 a {
16   color: #994D00;
17   text-decoration: none;
18 }
19 a:hover {
20   color: #FF8100;
21   background-color: #ff9;
22 }
1823 
1924 .fieldWithErrors {
2025   padding: 2px;