summaryrefslogtreecommitdiff
path: root/engines/support
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-23 15:27:40 +0200
committerAzul <azul@leap.se>2014-04-25 12:18:40 +0200
commit6c13d3323c180a333fd0f32d17a62adce9fcf2bb (patch)
treed38e5727ebf7d90c315211de4068dbd1d30e8b3e /engines/support
parent689c10b618c6c469ce82a7f09e117567def577de (diff)
using simple_form for the last form that was not using it.
Diffstat (limited to 'engines/support')
-rw-r--r--engines/support/app/controllers/tickets_controller.rb8
-rw-r--r--engines/support/app/views/tickets/_edit_form.html.haml8
2 files changed, 8 insertions, 8 deletions
diff --git a/engines/support/app/controllers/tickets_controller.rb b/engines/support/app/controllers/tickets_controller.rb
index 650f628..d552209 100644
--- a/engines/support/app/controllers/tickets_controller.rb
+++ b/engines/support/app/controllers/tickets_controller.rb
@@ -43,18 +43,18 @@ class TicketsController < ApplicationController
end
def update
- if params[:commit] == 'close'
+ if params[:button] == 'close'
@ticket.is_open = false
@ticket.save
redirect_to_tickets
- elsif params[:commit] == 'open'
+ elsif params[:button] == 'open'
@ticket.is_open = true
@ticket.save
redirect_to auto_ticket_path(@ticket)
else
@ticket.attributes = cleanup_ticket_params(params[:ticket])
- if params[:commit] == 'reply_and_close'
+ if params[:button] == 'reply_and_close'
@ticket.close
end
@@ -98,7 +98,7 @@ class TicketsController < ApplicationController
#
def redirect_to_tickets
if logged_in?
- if params[:commit] == t(:reply_and_close)
+ if params[:button] == t(:reply_and_close)
redirect_to auto_tickets_path
else
redirect_to auto_ticket_path(@ticket)
diff --git a/engines/support/app/views/tickets/_edit_form.html.haml b/engines/support/app/views/tickets/_edit_form.html.haml
index 714f8ff..7958334 100644
--- a/engines/support/app/views/tickets/_edit_form.html.haml
+++ b/engines/support/app/views/tickets/_edit_form.html.haml
@@ -17,7 +17,7 @@
regarding_user_link = ''
end
-= form_for @ticket do |f|
+= simple_form_for @ticket do |f|
= hidden_ticket_fields
%p.first
- if @ticket.is_open?
@@ -39,10 +39,10 @@
= t(:regarding_account)
= regarding_user_link
= f.text_field :regarding_user
- = f.button t(:save), :name => 'commit', :class => 'btn', :type => 'submit', :value => 'save'
+ = f.button :loading, t(:save), :value => 'save'
- if @ticket.is_open?
- = f.button t(:close), :name => 'commit', :class => 'btn', :type => 'submit', :value => 'close'
+ = f.button :loading, t(:close), :value => 'close'
- else
- = f.button t(:open), :name => 'commit', :class => 'btn', :type => 'submit', :value => 'open'
+ = f.button :loading, t(:open), :value => 'open'
- if admin?
= link_to t(:destroy), auto_ticket_path(@ticket), :confirm => t(:are_you_sure), :method => :delete, :class => 'btn'