Skip to content

Commit

Permalink
changed parts field to a text (from string) and added a drive time field
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Hoyt authored and Jonathan Hoyt committed Feb 4, 2009
1 parent 9b1a7fa commit dd84e27
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
3 changes: 1 addition & 2 deletions README.textile
Expand Up @@ -18,5 +18,4 @@ I've added monitoring support with custom built installers for windows pc's... i

bugs:
- parts field is a string instead of text
- fix monitor emails so they are more descriptive
-
- add drive time field to ticket entries
3 changes: 2 additions & 1 deletion app/views/ticket_entries/edit.html.erb
Expand Up @@ -10,8 +10,9 @@
<td class="first">Private</td><td><%= f.check_box :private %></td>
</tr>
<tr>
<td class="first">Time Spent</td><td><%= f.text_field :time, :title => "minutes" %></td>
<td class="first">Time Spent</td><td><%= f.text_field :time, :title => "minutes", :class => "short_field" %></td>
<td class="first">Labor Type</td><td><%= f.select :labor_type, ["Onsite", "Instore", "Remote", "System Build"], :include_blank => true %></td>
<td class="first">Drive Time</td><td><%= f.text_field :drive_time, :title => "minutes", :class => "short_field" %></td>
</tr>
</table>
<table>
Expand Down
2 changes: 1 addition & 1 deletion app/views/ticket_entries/index.html.erb
Expand Up @@ -9,7 +9,7 @@
<div id="ticket_entry_<%= entry.id %>" class="ticket_entry" detail="<%= entry.detail %>" entry_id="<%= entry.id %>">
<div class="ticket_entry_mugshot"><%= image_tag entry.creator.avatar.url(:avatar) %></div>
<p class="ticket_entry_byline">Entry by <b><%= entry.creator.name %></b> on <%= entry.updated_at.strftime("%H:%M %m/%d/%Y") %></p>
<p class="ticket_entry_details">Time Spent: <b><%= entry.time %> minutes</b> - Labor Type: <b><%= entry.labor_type %></b> - Billable? <b><%= billable(entry) %></b> - Private? <b><%= is_this_private(entry) %></b></p>
<p class="ticket_entry_details">Time Spent: <b><%= entry.time %> minutes</b> - Labor Type: <b><%= entry.labor_type %></b> - Billable? <b><%= billable(entry) %></b> - Drive Time: <b><%= entry.drive_time %></b></p>
<div class="ticket_entry_note"><%= textile_to_html(entry.note) %></div>
<div class="ticket_entry_parts"><b>Parts</b><br /><%= textile_to_html(entry.parts) %></div>
<div class="delete_button hide"><%= link_to_remote image_tag("/images/icons/delete.png"), :url => ticket_entry_url(entry), :method => :delete, :confirm => "Are you sure you want to delete this Ticket Entry?" %></div>
Expand Down
3 changes: 2 additions & 1 deletion app/views/ticket_entries/new.html.erb
Expand Up @@ -7,8 +7,9 @@
<td class="first">Private</td><td><%= f.check_box :private %></td>
</tr>
<tr>
<td class="first">Time Spent</td><td><%= f.text_field :time, :title => "minutes" %></td>
<td class="first">Time Spent</td><td><%= f.text_field :time, :title => "minutes", :class => "short_field" %></td>
<td class="first">Labor Type</td><td><%= f.select :labor_type, ["Onsite", "Instore", "Remote", "System Build"], :include_blank => true %></td>
<td class="first">Drive Time</td><td><%= f.text_field :drive_time, :title => "minutes", :class => "short_field" %></td>
</tr>
</table>
<table>
Expand Down
11 changes: 11 additions & 0 deletions db/migrate/20090204212338_fix_ticket_entries.rb
@@ -0,0 +1,11 @@
class FixTicketEntries < ActiveRecord::Migration
def self.up
change_column :ticket_entries, :parts, :text
add_column :ticket_entries, :drive_time, :integer
end

def self.down
change_column :ticket_entries, :parts, :string
remove_column :ticket_entries, :drive_time
end
end
5 changes: 3 additions & 2 deletions db/schema.rb
Expand Up @@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20081212174923) do
ActiveRecord::Schema.define(:version => 20090204212338) do

create_table "addresses", :force => true do |t|
t.string "context", :default => "Work", :null => false
Expand Down Expand Up @@ -240,7 +240,8 @@
t.datetime "created_at"
t.datetime "updated_at"
t.string "labor_type"
t.string "parts"
t.text "parts"
t.integer "drive_time"
end

create_table "tickets", :force => true do |t|
Expand Down
1 change: 1 addition & 0 deletions public/stylesheets/common.css
Expand Up @@ -4,6 +4,7 @@ a {text-decoration:none;color:#000;} /* make all my links black with no underlin
.hide {display:none;} /* just add this class to an element to hide it */
.remove-margins-padding {padding:0px;margin:0px;}
.blur {color:#ccc;}
input.short_field {width:80px;}

/* flash messages */
#header div.flash {position:fixed;top:1em;right:1em;z-index:0;text-align:right;font-size:1.2em;color:#555;}
Expand Down

0 comments on commit dd84e27

Please sign in to comment.