Skip to content

Commit

Permalink
Removing old hooks code
Browse files Browse the repository at this point in the history
  • Loading branch information
cyu authored and radar committed Jul 20, 2012
1 parent 3d633f5 commit 80002e7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 25 deletions.
5 changes: 2 additions & 3 deletions app/views/spree/admin/comment_types/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%- locals = {:f => f} -%>
<%= hook :admin_comment_type_form_fields, locals do %>
<div data-hook="admin_comment_type_form_fields">
<%= f.field_container :name do %>
<%= f.label :name, t(:name) %><br />
<%= f.text_field :name, :class => 'fullwidth title' %>
Expand All @@ -12,5 +11,5 @@
<%= error_message_on :comment_type, :applies_to%>
<% end %>

<% end %>
</div>

12 changes: 6 additions & 6 deletions app/views/spree/admin/comment_types/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<%= render :partial => 'spree/admin/shared/configuration_menu' %>

<%= hook :admin_comment_type_edit_form_header do %>
<div data-hook="admin_comment_type_edit_form_header">
<h1><%= t(:editing_comment_type) %></h1>
<%= render 'spree/shared/error_messages', :target => @comment_type %>
<% end %>
</div>

<%= hook :admin_comment_type_edit_form do %>
<div data-hook="admin_comment_type_edit_form">
<%= form_for(@comment_type, :url => object_url, :html => { :method => :put }) do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>

<%= hook :admin_comment_type_edit_form_buttons do %>
<div data-hook="admin_comment_type_edit_form_buttons">
<%= render :partial => 'spree/admin/shared/edit_resource_links' %>
<% end %>
</div>
<% end %>
<% end %>
</div>
15 changes: 5 additions & 10 deletions app/views/spree/admin/comment_types/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,23 @@
<table class="index">
<thead>
<tr>
<%= hook :admin_comment_types_index_headers do %>
<th><%= t(:name) %></th>
<th><%= t(:applies_to) %></th>
<% end %>
<th>
<% hook :admin_comment_types_index_header_actions %>
<div data-hook="admin_comment_types_index_header_actions"></div>
</th>
</tr>
</thead>
<tbody>
<% @comment_types.each do |comment_type| %>
<tr id="<%= dom_id comment_type %>">
<%- locals = {:comment_type => comment_type} -%>
<%= hook :admin_comment_types_index_rows, locals do %>
<td><%= comment_type.name %></td>
<td><%= comment_type.applies_to %></td>
<% end %>
<td><%= comment_type.name %></td>
<td><%= comment_type.applies_to %></td>
<td width="140px">
<%= hook :admin_comment_types_index_row_actions, locals do %>
<div data-hook="admin_comment_types_index_row_actions">
<%= link_to_edit comment_type %> &nbsp;
<%= link_to_delete comment_type %>
<% end %>
</div>
</td>
</tr>
<% end %>
Expand Down
12 changes: 6 additions & 6 deletions app/views/spree/admin/comment_types/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<%= render :partial => 'spree/admin/shared/configuration_menu' %>

<%= hook :admin_comment_type_new_form_header do %>
<div data-hook="admin_comment_type_new_form_header">
<h1><%= t(:new_comment_type) %></h1>

<%= render 'spree/shared/error_messages', :target => @comment_type %>
<% end %>
</div>

<%= hook :admin_comment_type_new_form do %>
<div data-hook="admin_comment_type_new_form">
<%= form_for(:comment_type, :url => collection_url) do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>

<%= hook :admin_comment_type_new_form_buttons do %>
<div data-hook="admin_comment_type_new_form_buttons">
<%= render :partial => 'spree/admin/shared/new_resource_links' %>
<% end %>
</div>
<% end %>
<% end %>
</div>

0 comments on commit 80002e7

Please sign in to comment.