summaryrefslogtreecommitdiff
path: root/help/app
diff options
context:
space:
mode:
Diffstat (limited to 'help/app')
-rw-r--r--help/app/controllers/tickets_controller.rb8
-rw-r--r--help/app/views/tickets/_edit_form.html.haml7
-rw-r--r--help/app/views/tickets/_new_comment_form.html.haml4
3 files changed, 8 insertions, 11 deletions
diff --git a/help/app/controllers/tickets_controller.rb b/help/app/controllers/tickets_controller.rb
index 6fc4024..094612c 100644
--- a/help/app/controllers/tickets_controller.rb
+++ b/help/app/controllers/tickets_controller.rb
@@ -41,20 +41,18 @@ class TicketsController < ApplicationController
end
def update
- if params[:commit] == t(:close)
+ if params[:commit] == 'close'
@ticket.is_open = false
@ticket.save
redirect_to_tickets
- elsif params[:commit] == t(:open)
+ elsif params[:commit] == 'open'
@ticket.is_open = true
@ticket.save
redirect_to auto_ticket_path(@ticket)
- elsif params[:commit] == t(:cancel)
- redirect_to_tickets
else
@ticket.attributes = cleanup_ticket_params(params[:ticket])
- if params[:commit] == t(:reply_and_close)
+ if params[:commit] == 'reply_and_close'
@ticket.close
end
diff --git a/help/app/views/tickets/_edit_form.html.haml b/help/app/views/tickets/_edit_form.html.haml
index 9846a43..5252c2e 100644
--- a/help/app/views/tickets/_edit_form.html.haml
+++ b/help/app/views/tickets/_edit_form.html.haml
@@ -39,11 +39,10 @@
= t(:regarding_account)
= regarding_user_link
= f.text_field :regarding_user
- = f.submit t(:save), :class => 'btn'
+ = f.button t(:save), :name => 'commit', :class => 'btn', :type => 'submit', :value => 'save'
- if @ticket.is_open?
- = f.submit t(:close), :class => 'btn'
+ = f.button t(:close), :name => 'commit', :class => 'btn', :type => 'submit', :value => 'close'
- else
- = f.submit t(:open), :class => 'btn'
+ = 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'
-
diff --git a/help/app/views/tickets/_new_comment_form.html.haml b/help/app/views/tickets/_new_comment_form.html.haml
index ff136f3..8418e01 100644
--- a/help/app/views/tickets/_new_comment_form.html.haml
+++ b/help/app/views/tickets/_new_comment_form.html.haml
@@ -7,7 +7,7 @@
= c.input :body, :label => false, :as => :text, :input_html => {:class => "full-width", :rows=> 5}
- if admin?
= c.input :private, :as => :boolean, :label => false, :inline_label => true
- = f.button :submit, t(:post_reply), :class => 'btn-primary'
+ = f.button :button, t(:post_reply), :name => 'commit', :class => 'btn-primary', :type => 'submit', :value => 'post_reply'
- if logged_in? && @ticket.is_open
- = f.button :submit, t(:reply_and_close)
+ = f.button :button, t(:reply_and_close), :name => 'commit', :class => 'btn', :type => 'submit', :value => 'reply_and_close'
= link_to t(:cancel), auto_tickets_path, :class => :btn