<% @preference.schedule_preference ||= SchedulePreference.new  %>
<% f.fields_for :schedule_preference do |bpf|  %>
  <% if view_type == :form %>
    <tr>
      <th>[<%=h SchedulePreference.human_attribute_name("visibility") %>]</th>
      <td>
        <% %w(friend_only member_only publiced).each do |name| %>
          <% value = SchedulePreference::VISIBILITIES[name.to_sym]  %>
          <%= bpf.radio_button :visibility, value %>
          <%= bpf.label "visibility_#{value}", t("schedule_preference.visibility_label.#{name}") %>
        <% end %>
      </td>
    </tr>
  <% else %>
    <tr>
      <th>[<%=h SchedulePreference.human_attribute_name("visibility") %>]</th>
      <td>
        <%=h t("schedule_preference.visibility_label.#{@preference.schedule_preference.visibility_name}") %>
        <%= bpf.hidden_field :visibility %>
      </td>
    </tr>
  <% end %>
<% end %>
