johnrees/fablabs

View on GitHub
app/views/projects/_project_collaboration_fields.html.haml

Summary

Maintainability
Test Coverage
.col-lg-4
  %label
    Labs collaborations
  .selection-container
    .icon
      %span
        = icon('map-marker')
  .selections
    %ul
      - @project.collaborations.each do |c|
        - if c.collaborator.present?
          %li
            %span
              = link_to icon('times'), collaboration_path(c), method: :delete
              = image_tag c.collaborator.avatar.thumb("50x50#").url, class: 'avatar tiny'

.col-lg-8
  - @selected = @project.collaborators.collect
  = select_tag :collaborations_attributes, options_from_collection_for_select(@selected, :id, :slug), { multiple: true, size: 10, name: 'project[collaborations_attributes][][collaborator_id]', class: 'lab_selection_attributes form-control'}