!!! %html

%head
  %title
    Fukuzatsu
  %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" } 
  %link{href: "https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css", rel: "stylesheet"}
  %script{language: "javascript", src: "https://code.jquery.com/jquery-1.11.0.min.js", type: "text/javascript"}
  %script{language: "javascript", src: "https://code.jquery.com/jquery-migrate-1.2.1.min.js", type: "text/javascript"}
  %script{language: "javascript", src: "https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js", type: "text/javascript"}

  %style{media: "screen", type: "text/css"}
    body { font-family: Arial, sans-serif; font-size: 13px; padding: 2em; }

    a { color: #900; }
    table { border: 4px solid #444; width: 100%; }

    tr.sort-controls th { background-color: #999 !important; font-size: .75em; text-transform: uppercase; text-align: left; }

    tr.header th, tfoot { background-color: #444 !important; color: #fff; }
    tfoot td { font-size: .75em; }
    tr.odd td { background-color: #eee; }

    div.dataTables_filter { margin-bottom: 2em !important; }
    div.dataTables_filter label { color: ::fff; }
    div.dataTables_paginate { display: none !important; }
    div.dataTables_info { display: none !important; }

%body
  %table{class: "output-table"}
    %thead
      %tr.header
        %th{colspan: 4}
          .file_meta
            %h1
              Project Overview
      %tr.sort-controls
        %th
          File
        %th
          Module/Class Name
        %th
          Complexity
        %th
          Details
    %tbody
      - summaries.each do |summary|
        %tr
          %td
            %a{href: "#{summary.source_file}.htm"}
              = summary.source_file
          %td
            - if summary.entity.full_name.size > 50
              = "..."
              = summary.entity.full_name[-49..-1]
            - else
              = summary.entity.full_name
          %td
            = sprintf("%0.2f", summary.average_complexity)
          %td
            %a{href: "#{summary.source_file}.htm"}
              View Details
    %tfoot
      %tr
        %td.center{colspan: 4}
          %em
            Analyzed on
            = date
            at
            = time
            by
            %a{href: "https://gitlab.com/coraline/fukuzatsu", target: "_new"}
              Fukuzatsu
  :javascript
    $(document).ready(function(){
      $('.output-table').dataTable({
        bLengthChange: false,
        iDisplayLength: 25000,
        "order": [[2, "desc"]]
      });
    });