forked from OpenNeo/impress
list visibility forms on Your Items
This commit is contained in:
parent
0c92bf5987
commit
11b7ae74db
2 changed files with 6 additions and 2 deletions
|
@ -23,10 +23,10 @@ module ClosetHangersHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def closet_visibility_descriptions
|
def closet_visibility_descriptions(subject='these items')
|
||||||
content = ''
|
content = ''
|
||||||
ClosetVisibility.levels.each do |level|
|
ClosetVisibility.levels.each do |level|
|
||||||
content << content_tag(:li, level.description('these items'), 'data-id' => level.id)
|
content << content_tag(:li, level.description(subject), 'data-id' => level.id)
|
||||||
end
|
end
|
||||||
content_tag :ul, content.html_safe, :class => 'visibility-descriptions'
|
content_tag :ul, content.html_safe, :class => 'visibility-descriptions'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
.closet-list{'data-id' => closet_list.id, 'data-hangers-count' => closet_list.hangers.count, :id => "closet-list-#{closet_list.id}"}
|
.closet-list{'data-id' => closet_list.id, 'data-hangers-count' => closet_list.hangers.count, :id => "closet-list-#{closet_list.id}"}
|
||||||
%header
|
%header
|
||||||
- if show_controls
|
- if show_controls
|
||||||
|
= form_for [closet_list.user, closet_list], :html => {:class => 'visibility-form'} do |f|
|
||||||
|
= f.select :visibility, closet_visibility_choices(:human_name)
|
||||||
|
= f.submit "Save"
|
||||||
|
= closet_visibility_descriptions('items in this list')
|
||||||
.closet-list-controls
|
.closet-list-controls
|
||||||
= link_to 'Edit', edit_user_closet_list_path(closet_list.user, closet_list)
|
= link_to 'Edit', edit_user_closet_list_path(closet_list.user, closet_list)
|
||||||
= form_tag user_closet_list_path(closet_list.user, closet_list), :method => 'delete' do
|
= form_tag user_closet_list_path(closet_list.user, closet_list), :method => 'delete' do
|
||||||
|
|
Loading…
Reference in a new issue