summaryrefslogtreecommitdiff
path: root/help/app/views/tickets/_edit_form.html.haml
blob: 714f8ff3a5d9bc823dad64f84e612094fd7896fa (plain)
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
:ruby
  # created by user link
  if @ticket.created_by_user
    created_by = link_to @ticket.created_by_user.login, @ticket.created_by_user
  else
    created_by = t(:anonymous)
  end

  # regarding user link
  if admin?
    if @ticket.regarding_user_actual_user
      regarding_user_link = link_to @ticket.regarding_user_actual_user.login, @ticket.regarding_user_actual_user
    else
      regarding_user_link =  "(#{t(:unknown)})"
    end
  else
    regarding_user_link = ''
  end

= form_for @ticket do |f|
  = hidden_ticket_fields
  %p.first
    - if @ticket.is_open?
      %span.label.label-info= t(:open)
    - else
      %span.label.label-success= t(:closed)
    %span.label.label-clear= t(:created_by_on, :user => created_by, :time => @ticket.created_at.to_s(:short)).html_safe
  %div= t(:subject)
  = f.text_field :subject, :class => 'large full-width'
  .row-fluid
    .span4
      %div= t(:status)
      = f.select :is_open, [[t(:open), "true"], [t(:closed), "false"]]
    .span4
      %div= t(:email)
      = f.text_field :email
    .span4
      %div
        = t(:regarding_account)
        = regarding_user_link
      = f.text_field :regarding_user
  = f.button t(:save), :name => 'commit', :class => 'btn', :type => 'submit', :value => 'save'
  - if @ticket.is_open?
    = f.button t(:close), :name => 'commit', :class => 'btn', :type => 'submit', :value => 'close'
  - else
    = f.button t(:open), :name => 'commit', :class => 'btn', :type => 'submit', :value => 'open'
  - if admin?
    = link_to t(:destroy), auto_ticket_path(@ticket),  :confirm => t(:are_you_sure), :method => :delete, :class => 'btn'