burningpony/phd_checker

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

Summary

Maintainability
Test Coverage
- content_for(:title) do
  User
  = @user.id
  %small participant: #{@user.participant_id} group: #{@user.group}

.panel.panel-default
  .panel-title.panel-heading Analysis
  %table.table.table-striped.table-hover

    -@user.analyze.each do |k,v|
      %tr
        %th=k.to_s.titleize
        %td{class: k}=v.to_s.titleize

.panel.panel-default
  .panel-title.panel-heading User
  %table.table.table-striped.table-hover
    %thead
      %tr
        -User.column_names.each do |v|
          %td=v.titleize

    %tr
      -@user.attributes.values.each do |v|
        %td=v

.panel.panel-default
  .panel-title.panel-heading Rounds
  %table.table.table-striped.table-hover
    %thead
      %tr
        -Round.column_names.each do |v|
          %td=v.titleize
    -@user.rounds.each do |round|
      %tr
        -round.attributes.values.each do |v|
          %td=v
.panel.panel-default
  .panel-title.panel-heading Responses
  %table.table.table-striped.table-hover
    %thead
      %tr
        -Response.column_names.each do |v|
          %td=v.titleize
    -@user.responses.each do |response|
      %tr.response{class: (response.correct ? '' : 'danger')}
        -response.attributes.each do |k,v|
          %td{class: k}=v

.actions
  = link_to fa_icon("pencil") + " " + t("web-app-theme.edit", :default=> "Edit"), edit_user_path(@user), :class => "btn btn-default"
  = link_to fa_icon("trash-o") + " " + t("web-app-theme.delete", :default => "Delete"), user_path(@user), :method => "delete", :class => "btn btn-default", :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}"

- content_for :sidebar, render(:partial => 'sidebar')