Don't show the list filter for petpage exports if you have no lists

This commit is contained in:
Emi Matchu 2024-09-20 19:30:23 -07:00
parent 4bc38db5aa
commit 40a3f5bf68

View file

@ -7,22 +7,23 @@
%p= twl '.instructions', %p= twl '.instructions',
:edit_petpage_link_url => 'https://www.neopets.com/edithomepage.phtml' :edit_petpage_link_url => 'https://www.neopets.com/edithomepage.phtml'
= form_tag petpage_user_closet_hangers_path(@user), :method => :get, :id => 'petpage-closet-lists' do - unless @closet_lists_by_owned.values.all?(&:empty?)
= hidden_field_tag 'filter', '1' = form_tag petpage_user_closet_hangers_path(@user), :method => :get, :id => 'petpage-closet-lists' do
- @closet_lists_by_owned.each do |owned, closet_lists| = hidden_field_tag 'filter', '1'
%div - @closet_lists_by_owned.each do |owned, closet_lists|
%h4= closet_lists_group_name(:you, owned) %div
%ul %h4= closet_lists_group_name(:you, owned)
- closet_lists.each do |closet_list| %ul
%li - closet_lists.each do |closet_list|
%li
= label_tag do
= check_box_tag "lists[#{closet_list.id}]", '1', petpage_closet_list_checked(closet_list, owned)
= closet_list.name
%li.unlisted
= label_tag do = label_tag do
= check_box_tag "lists[#{closet_list.id}]", '1', petpage_closet_list_checked(closet_list, owned) = check_box_tag "groups[#{owned}]", '1', petpage_group_checked(owned)
= closet_list.name = t 'closet_lists.unlisted_name'
%li.unlisted = submit_tag t('.submit')
= label_tag do
= check_box_tag "groups[#{owned}]", '1', petpage_group_checked(owned)
= t 'closet_lists.unlisted_name'
= submit_tag t('.submit')
%textarea#petpage-output %textarea#petpage-output
= '' + render('petpage_content', = '' + render('petpage_content',