jshoe/coursequestionbank

View on GitHub
app/views/instructors/show.html.haml

Summary

Maintainability
Test Coverage

%h3.section_title Your collections

%div.section_options
  = link_to 'New collection', new_collection_path, :class => 'btn btn-primary'
  = link_to 'Upload questions', upload_path, :class => 'btn btn-primary'


- if @collections.empty?
  %h4.section_body You have no collections.

- else
  %div.table-responsive.section_body
    %table.table.table-striped
      %thead
        %tr
          %th Name
          %th # Questions
          %th Description
          %th Last used
          %th Privacy
      
      %tbody
        - @collections.each do |collection|
          %tr
            %td= link_to collection.name.truncate(35), collection_path(:id => collection.id), :class => 'btn btn-link', :title => collection.name
            %td= collection.problems.length
            %td= collection.description
            %td= collection.last_used
            %td= collection.is_public ? 'Public' : 'Private'


// - if !@collections.empty?
//   %div.col-md-12
//     %div.table-responsive
//       %table.table.table-striped#collections
//         %thead
//           %tr
//           %th
//           %th Name
//           %th # Questions
//           %th Description
//           %th Last Used
//           %th Privacy
  
//         %tbody
//           - @collections.each do |collection|
//             %tr
//             %td
//               -if @current_user.current_collection == collection.id
//                 =link_to image_tag('yellowstar.png', width: 30), mark_as_current_path(:id => collection.id)
//               -else
//                 =link_to image_tag('graystar.png', width: 30), mark_as_current_path(:id => collection.id)
//             %td= link_to collection.name.truncate(35), edit_collection_path(:id => collection.id), :style => "color: " + collection.color.to_s
//             %td= collection.problems.length
//             %td= collection.description
//             %td= collection.last_used
//             %td= collection.is_public ? 'Public' : 'Private'