Commit f41b3a4

mo khan <mo@mokhan.ca>
2017-03-10 03:34:17
connect to autoview.
1 parent 209851f
Changed files (3)
app
assets
views
app/assets/javascripts/views/new_workout_view.js.coffee
@@ -1,4 +1,6 @@
-class Stronglifters.NewWorkoutView extends Backbone.View
+class Stronglifters.NewWorkoutView extends Stronglifters.Autoview
+  @viewName "new-workout-view"
+
   initialize: (options) ->
     @$el.find('div[name]').each (index, fieldset) ->
       view = new Stronglifters.NewSetView
app/views/programs/texas_method.html.erb
@@ -137,3 +137,5 @@
       </volume-day>
   </div>
 </div>
+
+<div class="container" data-autovue="timer"></div>
app/views/workouts/new.html.erb
@@ -5,7 +5,7 @@
         <%= link_to "Switch to Routine #{routine.name}", new_workout_path(routine_id: routine.id), class: 'button is-link is-pulled-right' %>
       <% end %>
       <h1 class="title">Routine <%= @routine.name %></h1>
-      <%= form_for @workout, remote: true do |f| %>
+      <%= form_for @workout, remote: true, data: { 'autoview-name': 'new-workout-view' } do |f| %>
         <%= f.hidden_field :routine_id %>
         <%= f.label :body_weight, class: 'label' %>
         <%= f.number_field :body_weight, class: 'input' %>
@@ -52,7 +52,3 @@
     </div>
   </div>
 </div>
-
-<% content_for :javascript do %>
-  window.currentView = new Stronglifters.NewWorkoutView({ el: $('#new_workout') });
-<% end %>