burningpony/phd_checker

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

Summary

Maintainability
Test Coverage
- content_for :sidebar, render(:partial => 'sidebar')
- content_for(:title) do
  = t("web-app-theme.all", :default => "All")
  Users

%table.table.table-striped
  %thead
    %tr
      %th.first Group
      %th
        = t("activerecord.attributes.user.name", :default => t("activerecord.labels.name", :default => "ID"))
      %th Treatment
      %th Responses(Correct)
      %th Responses(Incorrect)
      %th Job
      %th Available treatments
      %th= t("web-app-theme.created_at", :default => "Created at")
      %th= t("web-app-theme.updated_at", :default => "Updated at")
      %th.last &nbsp
  - @users.each do |user|
    %tr
      %td= user.group
      %td= link_to user.id, user_path(user)
      %td
        = user.rounds.pluck(:name).compact.first.try(:to_i)
        %small.text-muted= user.responses.pluck(:controller).compact.first
      %td= user.responses.correct.count
      %td= user.responses.incorrect.count
      %td= user.job
      %th= user.available_payments.to_s
      %td= user.created_at
      %td= user.updated_at
      %td
        = link_to fa_icon('user') + " Show", user_path(user.id), class: "btn btn-default btn-xs"
        = link_to fa_icon('trash') + " #{t("web-app-theme.delete", :default => "Delete")}", user_path(user), :method => :delete, :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}", class: "btn btn-danger btn-xs"