Justinzh1/Emunah

View on GitHub
app/views/home/dash.html.haml

Summary

Maintainability
Test Coverage
.container
  %h1.header-container 
    = "Welcome " + @user.full_name
  %p 
    = "Last login on "
    %span
      = @last_login
  - flash.each do |type, msg|
    %strong
      = msg

  %h2 Account Settings
  %p 
    ="Click to"
    =link_to("edit", edit_user_path(@user.id))
    ="profile"
  %br
  - if @user.role === "admin"
    = button_to 'Users', users_path, :method => :get, class: "btn btn-default"
  %br
  = button_to 'Families', families_path, :method => :get, class: "btn btn-default"
  %br
  = button_to 'Assigned Tasks', user_tasks_path(@user.id), :method => :get, class: "btn btn-default"
  %br
  = button_to 'All Tasks', user_all_tasks_path(@user.id), :method => :get, class: "btn btn-default"
  %br
  = button_to 'All Submittals', user_submittals_path(@user.id), :method => :get, class: "btn btn-default"
  %br
  %h2 All Recent Submittal Entries
  = react_component("SubmittalsList", {submittals: @submittals, role: @user.role, is_dash: "true"})