swchoi727/LEP

View on GitHub
app/views/admins/show_pair.html.haml

Summary

Maintainability
Test Coverage
%h2= "Pair #{@pair.id}"

- if !@users.nil?
  = link_to 'Add User', admin_view_users_path(:pair_id => @pair.id, :id => @user.id, :class => "btn edit-prof")

%table.table
  %thead
    %tr
      %th Name
      %th Language preference
  %tbody
    - @members.each do |id, name|
      %tr
      - if !id.nil? and !id.empty?
        %td= name
        %td= User.find(id).first_lang_preference
        %td= User.find(id).second_lang_preference
        
        %td= link_to 'Remove User', admin_remove_from_pair_path(:pair_id => @pair.id, :id => @user.id, :user_id => id.to_i)

%h4= "Pair Languages"
/= @pair.languages.empty? ? 'N/A' : @pair.get_languages
= "#{@pair.languages[0]}, #{@pair.languages[1]}"