Sha256: 3d6e17924932e1ea56669f2b7f92ea052d31ed96a08bbfb65428728ca3f38ca7

Contents?: true

Size: 1.21 KB

Versions: 19

Compression:

Stored size: 1.21 KB

Contents

<%
#Since the data is in yaml coming out of the DB it is converted here from
#comparision. This is  a hack to get things working.
unless categories.nil?
  selected = YAML::load(categories)
else
  selected = Hash.new
end
-%>
<select name="itunes_category[]" id="resource_itunes_category_<%= id %>" size="3" multiple="multiple">
  <% @itunes_category_list.each do |h|
    h.each_pair do |cat,subcats| -%>
    <% # not a great way of handling this but it looks better -%>
      <% if selected.key?(cat)  -%>
        <option value="<%=h cat %>" selected="selected"><%=h cat %></option>
      <% else -%>
        <option value="<%=h cat %>"><%=h cat %></option>
      <% end -%>
      <% subcats.each do |subcat| -%>
        <% unless selected[cat].nil? -%>
          <% if selected[cat].include?(subcat) -%>
            <option value="<%=h cat %>-<%=h subcat %>" selected="selected">&nbsp;-<%=h subcat %></option>
          <% else -%>
            <option value="<%=h cat %>-<%=h subcat %>">&nbsp;-<%=h subcat %></option>
          <% end -%>
        <% else -%>
          <option value="<%=h cat %>-<%=h subcat %>">&nbsp;-<%=h subcat %></option>
        <% end -%>
      <% end unless subcats.nil?  %>
    <% end -%>
  <% end -%>
</select>

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
typo-5.4.3 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.4.2 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.4.1 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.4 app/views/admin/resources/_itunes_category_edit.html.erb
typo-4.1.1 app/views/admin/resources/_itunes_category_edit.rhtml
typo-5.0.1 app/views/admin/resources/_itunes_category_edit.html.erb
typo-4.1 app/views/admin/resources/_itunes_category_edit.rhtml
typo-5.0.2 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.0.3.98.1 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.0 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.0.3.98 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.1.1 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.1.2 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.1.3 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.1 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.1.98 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.2 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.2.98 app/views/admin/resources/_itunes_category_edit.html.erb
typo-5.3 app/views/admin/resources/_itunes_category_edit.html.erb