Browse Source

Update employee/people entry forms

master
jimi 16 years ago
committed by jimi
parent
commit
bc46363820
  1. 97
      app/views/employees/_form.html.erb
  2. 16
      app/views/people/_form.html.erb
  3. 33
      public/stylesheets/application.css

97
app/views/employees/_form.html.erb

@ -1,40 +1,65 @@
<% form_for @employee do |f| %> <% form_for @employee do |f| %>
<%= f.error_messages %> <%= f.error_messages %>
<p>
<%= f.label :number %><br />
<%= f.text_field :number %>
</p>
<p>
<%= f.label :firstname %><br />
<%= f.text_field :firstname %>
</p>
<p>
<%= f.label :lastname %><br />
<%= f.text_field :lastname %>
</p>
<p>
<%= f.label :ssn %><br />
<%= f.text_field :ssn %>
</p>
<p>
<%= f.label :dob %><br />
<%= f.date_select :dob, :start_year => Time.now.year - 70, :end_year => Time.now.year - 17, :default => Time.now - 30.years %>
</p>
<p>
<%= f.label :hired %><br />
<%= f.date_select :hired, :start_year => Time.now.year - 10, :end_year => Time.now.year + 1 %>
</p>
<p>
<%= f.label :tax_status %><br />
<%= f.text_field :tax_status %>
</p>
<p>
<%= f.label :dependents %><br />
<%= f.text_field :dependents %>
</p>
<p>
<%= f.label :payrate %><br />
<%= f.text_field :payrate %>
</p>
<dl>
<fieldset class="left">
<legend>Personal</legend>
<dt><%= f.label :number %></dt>
<dd><%= f.text_field :number %></dd>
<dt><%= f.label :firstname %></dt>
<dd><%= f.text_field :firstname %></dd>
<dt><%= f.label :lastname %></dt>
<dd><%= f.text_field :lastname %></dd>
<dt><%= f.label :dob %></dt>
<dd><%= f.date_select :dob, :start_year => Time.now.year - 70,
:end_year => Time.now.year - 17, :default => Time.now - 30.years %>
</dd>
<dt><%= f.label :phone %></dt>
<dd><%= f.text_field :phone %></dd>
</fieldset>
<fieldset class="right">
<legend>Tax Info</legend>
<!-- Pay Info -->
<dt><%= f.label :ssn %></dt>
<dd><%= f.text_field :ssn %></dd>
<dt><%= f.label :payrate %></dt>
<dd><%= f.text_field :payrate %></dd>
<dt><%= f.label :tax_status %></dt>
<dd><%= f.text_field :tax_status %></dd>
<dt><%= f.label :dependents %></dt>
<dd><%= f.text_field :dependents %></dd>
<dt><%= f.label :hired %></dt>
<dd><%= f.date_select :hired, :start_year => Time.now.year - 10,
:end_year => Time.now.year + 1, :default => Time.now %>
</dd>
</fieldset>
<fieldset class="left">
<!-- Address Info -->
<legend>Address</legend>
<dt><%= f.label :street %></dt>
<dd><%= f.text_field :street %></dd>
<dt><%= f.label :city %></dt>
<dd><%= f.text_field :city %></dd>
<dt><%= f.label :state %></dt>
<dd><%= f.text_field :state %></dd>
<dt><%= f.label :zip %></dt>
<dd><%= f.text_field :zip %></dd>
</fieldset>
<fieldset class="right">
<legend>Vehicle Info</legend>
<!-- License Info -->
<dt><%= f.label :dl_number %></dt>
<dd><%= f.text_field :dl_number %></dd>
<dt><%= f.label :dl_state %></dt>
<dd><%= f.text_field :dl_state %></dd>
<dt><%= f.label :dl_expire %></dt>
<dd><%= f.text_field :dl_expire %></dd>
<!-- Truck Info -->
<dt><%= f.label :truck %></dt>
<dd><%= f.text_field :truck %></dd>
<dt><%= f.label :trailer %></dt>
<dd><%= f.text_field :trailer %></dd>
</fieldset>
</dl>
<hr class="clear">
<p><%= f.submit "Submit" %></p> <p><%= f.submit "Submit" %></p>
<% end %> <% end %>

16
app/views/people/_form.html.erb

@ -1,12 +1,12 @@
<% form_for @person do |f| %> <% form_for @person do |f| %>
<%= f.error_messages %> <%= f.error_messages %>
<p>
<%= f.label :firstname %><br />
<%= f.text_field :firstname %>
</p>
<p>
<%= f.label :lastname %><br />
<%= f.text_field :lastname %>
</p>
<dl>
<dt><%= f.label :firstname %></dt>
<dd><%= f.text_field :firstname %></dd>
<dt><%= f.label :lastname %></dt>
<dd><%= f.text_field :lastname %></dd>
<dt><%= f.label :phone %></dt>
<dd><%= f.text_field :phone %></dd>
</dl>
<p><%= f.submit "Submit" %></p> <p><%= f.submit "Submit" %></p>
<% end %> <% end %>

33
public/stylesheets/application.css

@ -2,7 +2,7 @@ html {
overflow-y: scroll; overflow-y: scroll;
} }
body { body {
background-color: #ffc;
background-color: #ccc;
font-family: Verdana, sans-serif; font-family: Verdana, sans-serif;
padding: 0.75em; padding: 0.75em;
line-height: 1.333; line-height: 1.333;
@ -134,6 +134,14 @@ p.nav {
list-style: disc; list-style: disc;
} }
.left {
float: left;
}
.right {
float: right;
}
.light { .light {
background-color: #e3e3e3; background-color: #e3e3e3;
} }
@ -164,3 +172,26 @@ p.nav {
.listing td.number { .listing td.number {
width: 2.5em; width: 2.5em;
} }
form dl {
margin-bottom: 1em;
display: inline;
}
form dt {
font-size: 70%;
font-weight: bold;
}
fieldset {
width: 46%;
border: groove 2px #666;
padding: 0.5em 0.375em 1.25em 0.375em;
margin-bottom: 1em;
}
legend {
font-size: 80%;
font-weight: bold;
padding: 0 0.5em;
}