=provide(:title, "Group Index")

<!-- Top Pagination Bar -->
.pagination-container
  = will_paginate @groups, renderer: BootstrapPagination::Rails
  .pull-right.pagination
    = label_tag :per_page_top, "Display per page:"
    = select_tag :per_page_top, options_for_select([20,50,100,"All"], params[:per_page]), :onchange => "if(this.value){window.location='?per_page='+this.value;}"

<!-- Layout the matrix table -->
.col-sm-12
  %table.table.table-striped#groups
    %thead
      %tr
        %th Group Name
        %th{style: "text-align: center;"} Number of Matrices
        %th Description
    %tbody
      - @groups.each do |group|
        %tr
          %td= link_to "#{group.name}", "/#{group.name}"
          %td{style: "text-align: center;"}= group.num_matrices
          %td= group.notes.lines.first

<!-- Bottom Pagination Bar -->
.pagination-container
  = will_paginate @groups, renderer: BootstrapPagination::Rails
  .pull-right.pagination
    = label_tag :per_page_bottom, "Display per page:"
    = select_tag :per_page_bottom, options_for_select([20,50,100,"All"], params[:per_page]), :onchange => "if(this.value){window.location='?per_page='+this.value;}"


=provide(:title, "Group Index")

<!-- Top Pagination Bar -->
.pagination-container
  = will_paginate @groups, renderer: BootstrapPagination::Rails
  .pull-right.pagination
    = label_tag :per_page_top, "Display per page:"
    = select_tag :per_page_top, options_for_select([20,50,100,"All"], params[:per_page]), :onchange => "if(this.value){window.location='?per_page='+this.value;}"

<!-- Layout the matrix table -->
.col-sm-12
  %table.table.table-striped#groups
    %thead
      %tr
        %th Group Name
        %th{style: "text-align: center;"} Number of Matrices
        %th Description
    %tbody
      - @groups.each do |group|
        %tr
          %td= link_to "#{group.name}", "/#{group.name}"
          %td{style: "text-align: center;"}= group.num_matrices
          %td= group.notes.lines.first unless group.notes.nil?

<!-- Bottom Pagination Bar -->
.pagination-container
  = will_paginate @groups, renderer: BootstrapPagination::Rails
  .pull-right.pagination
    = label_tag :per_page_bottom, "Display per page:"
    = select_tag :per_page_bottom, options_for_select([20,50,100,"All"], params[:per_page]), :onchange => "if(this.value){window.location='?per_page='+this.value;}"


Fix group listing error when group has no notes
Fix group listing error when group has no notes
