.ticket
%div.avatar
%img{:src => Gravatar.new(@ticket.assigned, :size => 60), :alt => "#{@ticket.assigned_name}'s avatar"}
%h1= @title
.details
assigned to
%strong= @ticket.assigned_name
\/
= @ticket.opened
%br
%span{:class => @ticket.state}= @ticket.state
\/
%span.tags
- unless @ticket.tags.empty?
- @ticket.tags.each do |tag|
%a{:href => "/tickets/tags/#{tag}"}= tag
- else
none
%h3 Comments
- unless @ticket.comments.empty?
- @ticket.comments.each do |c|
.comment
%p
%img.avatar{:src => Gravatar.new(c.user, :size => 30), :alt => "#{c.user}'s avatar"}
Added
= c.added.strftime("%m/%d %H:%M")
by
%strong= c.user
%div= RedCloth.new(c.comment).to_html
- else
%p There are no comments for this issue
%h3 Update the Ticket
%form{:action => "/tickets/#{@ticket.ticket_id}", :method => 'POST'}
%input{:type => 'hidden', :name => '_method', :value => 'PUT'}
%dl
%dt
%label{:for => 'ticket_comment'} Comment
%dd
= find_and_preserve do
%textarea#ticket_comment{:name => 'ticket_comment', :rows => 15, :cols => 30}
%dt
%label{:for => 'ticket_assigned'} Assigned To
%dd
%input#ticket_assigned{:type => 'text', :name => 'ticket_assigned', :size => 30, :class => 'text', :value => @ticket.assigned}
%dt
%label{:for => 'ticket_state'} State
%dd
%select#ticket_state{:name => 'ticket_state'}
- %w(open resolved hold invalid).each do |state|
- options = state == @ticket.state ? { :selected => 'selected' } : {}
%option{options, :value => state}= state.capitalize
%dt
%label{:for => 'ticket_tags'} Tags
%dd
%input#ticket_tags{:type => 'text', :name => 'ticket_tags', :size => 30, :class => 'text', :value => @ticket.tags.join(",")}
%br
%span separate with commas
%p
%input{:type => 'submit', :value => 'Update Ticket'}