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
|
||||
|
||||
def closet_visibility_descriptions
|
||||
def closet_visibility_descriptions(subject='these items')
|
||||
content = ''
|
||||
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
|
||||
content_tag :ul, content.html_safe, :class => 'visibility-descriptions'
|
||||
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}"}
|
||||
%header
|
||||
- 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
|
||||
= 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
|
||||
|
|
Loading…
Reference in a new issue