From df0783b8344c432079464b79483f37bd2b7b1e2c Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sat, 11 Feb 2012 17:01:10 -0500 Subject: [PATCH] Gutting all habit views from server --- app/views/habits/_form.html.erb | 29 ----------------------------- app/views/habits/_habit.html.erb | 21 --------------------- app/views/habits/completed.erb | 22 ---------------------- app/views/habits/edit.html.erb | 6 ------ app/views/habits/new.html.erb | 5 ----- app/views/habits/vote.js.erb | 5 ----- 6 files changed, 88 deletions(-) delete mode 100644 app/views/habits/_form.html.erb delete mode 100644 app/views/habits/_habit.html.erb delete mode 100644 app/views/habits/completed.erb delete mode 100644 app/views/habits/edit.html.erb delete mode 100644 app/views/habits/new.html.erb delete mode 100644 app/views/habits/vote.js.erb diff --git a/app/views/habits/_form.html.erb b/app/views/habits/_form.html.erb deleted file mode 100644 index d905bb2a19..0000000000 --- a/app/views/habits/_form.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<%= form_for(@habit) do |f| %> - <% if @habit.errors.any? %> -
-

<%= pluralize(@habit.errors.count, "error") %> prohibited this habit from being saved:

- - -
- <% end %> - -
- <%= f.label :name %>
- <%= f.text_field :name %> -
-
- <%= f.label :habit_type %>
- <%= f.select :habit_type, options_for_select([['Always',1], ['Daily',2], ['One-time',3]], @habit.habit_type) %> -
-
- <%= f.label :notes %>
- <%= f.text_area :notes %> -
-
- <%= f.submit %> -
-<% end %> diff --git a/app/views/habits/_habit.html.erb b/app/views/habits/_habit.html.erb deleted file mode 100644 index 9749167f9e..0000000000 --- a/app/views/habits/_habit.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -
  • - <% if habit.habit_type==Habit::ALWAYS %> - <%= vote_link(habit, 'up') %> - <%= vote_link(habit, 'down') %> - <%= habit.name %> - <% else %> - <% if habit.done %> - <%= vote_link(habit, 'checked') %> - <%= habit.name %> - <% else %> - <%= vote_link(habit, 'unchecked') %> - <%= habit.name %> - <% end %> - <% end %> -
    - <% if habit.notes.present? %> - <%= image_tag('comment.png', :class=>'comment') %>
    <%= habit.notes %>
    - <% end %> - <%= link_to 'Edit', edit_habit_path(habit) %> -
    -
  • diff --git a/app/views/habits/completed.erb b/app/views/habits/completed.erb deleted file mode 100644 index 048f400c6c..0000000000 --- a/app/views/habits/completed.erb +++ /dev/null @@ -1,22 +0,0 @@ -<%= link_to 'Back', habits_url %> - - - - - - - -
    -
    -
    -

    Completed

    -
    -
      - <% @one_time.each do |habit| %> - <%= render :partial => "habit", :locals => { :habit => habit } %> - <% end %> -
    -
    -
    -
    -
    diff --git a/app/views/habits/edit.html.erb b/app/views/habits/edit.html.erb deleted file mode 100644 index f4d13a5b70..0000000000 --- a/app/views/habits/edit.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -

    Editing habit

    - -<%= render 'form' %> - -<%= link_to 'Destroy', @habit, confirm: 'Are you sure?', method: :delete %> | -<%= link_to 'Back', habits_path %> diff --git a/app/views/habits/new.html.erb b/app/views/habits/new.html.erb deleted file mode 100644 index df5782ccba..0000000000 --- a/app/views/habits/new.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

    New habit

    - -<%= render 'form' %> - -<%= link_to 'Back', habits_path %> diff --git a/app/views/habits/vote.js.erb b/app/views/habits/vote.js.erb deleted file mode 100644 index 44f9319c36..0000000000 --- a/app/views/habits/vote.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% unless @habit.habit_type==Habit::ONE_TIME %> - $('#habit_<%= @habit.id %>').replaceWith("<%= escape_javascript(render :partial => "habit", :locals => { :habit => @habit }) %>"); -<% end %> -$('#progressbar').replaceWith("<%= escape_javascript(render :partial => "shared/progressbar") %>"); -$('#money').replaceWith("<%= escape_javascript(render 'shared/money') %>");