app/views/admin/zones/_form.html.erb in spree-0.7.1 vs app/views/admin/zones/_form.html.erb in spree-0.8.0
- old
+ new
@@ -1,68 +1,29 @@
-<script type='text/javascript'>
- <%= render :partial => 'function.rjs' %>
-</script>
-<table>
- <tr>
- <td><%= t("name") %>:</td>
- <td><%=f.text_field :name %></td>
- </tr>
- <tr>
- <td><%= t("description") %>:</td>
- <td><%=f.text_field :description %></td>
- </tr>
- <tr>
- <td><%= t("type") %>: </td>
- <td>
- <input type="radio"
- name="type" <%=country_checked %>
- onclick="Element.show('country-based'); Element.hide('state-based'); Element.hide('zone-based');"
- value="country"><%= t("country_based") %></input>
- <input type="radio"
- name="type" <%=state_checked %>
- onclick="Element.show('state-based'); Element.hide('country-based'); Element.hide('zone-based');"
- value="state"><%= t("state_based") %></input>
- <input type="radio"
- name="type" <%=zone_checked %>
- onclick="Element.show('zone-based'); Element.hide('country-based'); Element.hide('state-based');"
- value="zone"><%= t("zone_based") %></input>
- </td>
- </tr>
-</table>
-<br/>
-<div id="country-based" <%= "style='display:none'" if country_checked.blank? %> >
- <h2><%= t("country") %></h2>
- <ul id="country-list" class="zone-member-list">
- <% @object.countries.each do |country| %>
- <%= render :partial => "country", :locals => {:value => country.name} %>
- <% end %>
- <%= render :partial => "country" if @object.countries.empty?%>
- </ul>
- <br/>
- <%= link_to_function(t('add_country'), 'add_country()' ) %>
-</div>
+<% zone_form.field_container :name do %>
+ <%= zone_form.label :name, t("name") %><br />
+ <%=zone_form.text_field :name %></td>
+<% end %>
-<div id="state-based" <%= "style='display:none'" if state_checked.blank? %> >
- <h2><%= t("states") %></h2>
- <ul id="state-list" class="zone-member-list">
- <% @object.states.each do |state| %>
- <%= render :partial => "state", :locals => {:value => state.name} %>
- <% end %>
- <%= render :partial => "state" if @object.states.empty?%>
- </ul>
- <br/>
- <%= link_to_function(t('add_state'), 'add_state()' ) %>
-</div>
+<% zone_form.field_container :description do %>
+ <%= zone_form.label :description, t("description") %><br />
+ <%=zone_form.text_field :description %>
+<% end %>
-<div id="zone-based" <%= "style='display:none'" if zone_checked.blank? %> >
- <h2><%= t("zones") %></h2>
- <ul id="zone-list" class="zone-member-list">
- <% @object.zones.each do |zone| %>
- <%= render :partial => "zone", :locals => {:value => zone.name} %>
- <% end %>
- <%= render :partial => "zone" if @object.zones.empty?%>
- </ul>
- <br/>
- <%= link_to_function(t('add_zone'), 'add_zone()' ) %>
-</div>
+<p>
+ <label><%= t("type") %></label><br />
+ <label class="sub">
+ <%= zone_form.radio_button("kind", "country", {:id => "country_based"}) %>
+ <%= t("country_based") %>
+ </label>
+ <label class="sub">
+ <%= zone_form.radio_button("kind", "state", {:id => "state_based"}) %>
+ <%= t("state_based") %>
+ </label>
+ <label class="sub">
+ <%= zone_form.radio_button("kind", "zone", {:id => "zone_based"}) %>
+ <%= t("zone_based") %>
+ </label>
+</p>
-<br/><br/>
+<%= render "member_type", :type => "country", :zone_form => zone_form %>
+<%= render "member_type", :type => "state", :zone_form => zone_form %>
+<%= render "member_type", :type => "zone", :zone_form => zone_form %>
\ No newline at end of file