added a new vulnerability plus completed the work info page
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class WorkInfoController < ApplicationController
|
||||
|
||||
def index
|
||||
@user = current_user
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
class WorkInfo < ActiveRecord::Base
|
||||
attr_accessible :DoB, :SSN, :bonuses, :income, :user_id, :years_worked
|
||||
attr_accessible :DoB, :SSN, :bonuses, :income, :years_worked
|
||||
belongs_to :user
|
||||
|
||||
# We should probably use this
|
||||
def last_four
|
||||
"***-**-" << self.SSN[-4,4]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<div class="dashboard-wrapper">
|
||||
<div class="main-container">
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="widget">
|
||||
<div class="widget-header">
|
||||
<div class="title">
|
||||
<span class="fs1" aria-hidden="true" data-icon=""></span> Employee Information
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-body">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:16%">Full Name</th>
|
||||
<th style="width:16%">Income</th>
|
||||
<th style="width:16%">Bonuses</th>
|
||||
<th style="width:16%">Years w/ MetaCorp</th>
|
||||
<th style="width:16%">SSN</th>
|
||||
<th style="width:16%">DoB</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td><%= "#{@user.first_name} #{@user.last_name}" %></td>
|
||||
<td><%= @user.work_info.income %></td>
|
||||
<td><%= @user.work_info.bonuses %></td>
|
||||
<td><%= @user.work_info.years_worked %></td>
|
||||
<td><%= @user.work_info.SSN %></td>
|
||||
<td><%= @user.work_info.DoB %></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+42
@@ -144,6 +144,42 @@ paid_time_off = [
|
||||
|
||||
]
|
||||
|
||||
work_info = [
|
||||
|
||||
{
|
||||
:user_id => 2,
|
||||
:income => "$50,000",
|
||||
:bonuses => "$10,000",
|
||||
:years_worked => 2,
|
||||
:SSN => "555-55-5555",
|
||||
:DoB => "01-01-1980"
|
||||
},
|
||||
{
|
||||
:user_id => 3,
|
||||
:income => "$40,000",
|
||||
:bonuses => "$10,000",
|
||||
:years_worked => 1,
|
||||
:SSN => "333-33-3333",
|
||||
:DoB => "01-01-1979"
|
||||
},
|
||||
{
|
||||
:user_id => 4,
|
||||
:income => "$60,000",
|
||||
:bonuses => "$12,000",
|
||||
:years_worked => 3,
|
||||
:SSN => "444-44-4444",
|
||||
:DoB => "01-01-1981"
|
||||
},
|
||||
{
|
||||
:user_id => 5,
|
||||
:income => "$30,000",
|
||||
:bonuses => "7,000",
|
||||
:years_worked => 1,
|
||||
:SSN => "222-22-2222",
|
||||
:DoB => "01-01-1982"
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
users.each do |user_info|
|
||||
user = User.new(user_info.reject {|k| k == :user_id})
|
||||
@@ -169,3 +205,9 @@ schedule.each do |event|
|
||||
sched.user_id = event[:user_id]
|
||||
sched.save
|
||||
end
|
||||
|
||||
work_info.each do |wi|
|
||||
info = WorkInfo.new(wi.reject {|k| k == :user_id})
|
||||
info.user_id = wi[:user_id]
|
||||
info.save
|
||||
end
|
||||
Reference in New Issue
Block a user