DrakeW/projectscope

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

Summary

Maintainability
Test Coverage
%h3#gap Project List


#gap= link_to "Preference", user_path(current_user), :class => "btn btn-primary"

%table#projectlist
  %thead
    %tr
      %th{:class => @class}= link_to "Project Name", projects_path(:type => "project_name"), :id => "project_name"
      - @metric_names.each do |metric_name|
        %th{:class => @class}= link_to metric_name, projects_path(:type => metric_name), :id => metric_name
  
  %tbody
    - @projects.each do |project|
      %tr
        %td= link_to project.name, project
        - project.latest_metric_samples.each do |sample|
          - if is_selected_metric? sample
            %td{:id => "#{project.name}_#{sample.try(:metric_name)}_metric"}
              = '%.2f'.try(:%,sample.try(:score) || 0.0)
              #{raw sample.try(:image)}

%br/

= link_to 'Create New Project', new_project_path, :class => "btn btn-primary"