<% # Display a user and their proposals/sessions with conditional formatting. # # Locals: # * user => The User to display. REQUIRED. # * wrapper_tag => Tag to wrap the display in. Defaults to :div. # * display_sub_list => Should a sub_list, a detailed list of proposals/sessions for the user, be displayed? Defaults to false. # * hide_rooms => Should the rooms be hidden in the list of sessions displayed for each user? Defaults to false. # * only_for_event => Only display entries associated with this event record or its children. Optional. hide_rooms ||= false wrapper_tag ||= :div display_sub_list ||= false only_for_event = local_assigns[:only_for_event] %> <%= content_tag wrapper_tag, :class => "user_box vcard #{admin? && user.admin? ? ' admin' : ''}" do %> <%= link_to( image_tag( user.photo.url(:profile), :class => 'user-photo photo' ), user ) if user.photo.file? %>

<%= link_to user.label, user, :name => "id_#{user.id}", :id => "id_#{user.id}", :class => 'fn n' %>

<% unless user.affiliation.blank? -%> <%= user.affiliation %> <% end -%>
<% unless user.biography.blank? %>

Biography

<%= display_textile_for user.biography %>
<% end %> <% if can_edit?(user) %>
<%= link_to "Edit user", edit_user_path(user), :class => "editable" %>
<% end %> <% if display_sub_list %> <%= render :partial => 'open_conference_ware/proposals/sub_list', :locals => { :container => user, :header_tag => :h4 } %> <% else %> <% if @event.proposal_status_published? %> <% # Use prefetched values sessions = @sessions_for_user_hash.try(:fetch, user.id, nil) || user.sessions sessions = @event.related_proposals(sessions) if only_for_event %> <% unless sessions.empty? %>

Sessions

<%= render :partial => 'open_conference_ware/proposals/list_concise', :locals => { :items => sessions, :hide_rooms => hide_rooms } %> <% end %> <% end -%> <% end -%>
<% end -%>