public
Description: Provide a nicer looking web interface for ticgit
Clone URL: git://github.com/pope/ticgit-watchtower.git
Search Repo:
ticgit-watchtower / views / show.haml
100644 70 lines (59 sloc) 1.996 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.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'}