summaryrefslogtreecommitdiff
path: root/engines/support/app/views/tickets/_edit_form.html.haml
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-20 12:30:55 +0200
committerAzul <azul@leap.se>2014-05-26 12:59:26 +0200
commit467dd712a19d48fc653cfc0e58201e6657d2c1f9 (patch)
tree44a44fec523843652d1c0bc0ba410f6e7710b3d7 /engines/support/app/views/tickets/_edit_form.html.haml
parent7638970e233eaebc48abd499c37c274b48c97a96 (diff)
split up and refactor TicketController#update
close and open actions for plain opening and closing the tickets respond_with so fields are not cleared on invalid update the custom actions are not strictly restful. But adding a subresource felt like too much overhead and is conceptually hard to grasp (so we destroy the openess of the ticket to close it?).
Diffstat (limited to 'engines/support/app/views/tickets/_edit_form.html.haml')
-rw-r--r--engines/support/app/views/tickets/_edit_form.html.haml7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/support/app/views/tickets/_edit_form.html.haml b/engines/support/app/views/tickets/_edit_form.html.haml
index b8da779..22815f2 100644
--- a/engines/support/app/views/tickets/_edit_form.html.haml
+++ b/engines/support/app/views/tickets/_edit_form.html.haml
@@ -17,17 +17,18 @@
regarding_user_link = ''
end
-= simple_form_for @ticket do |f|
+- url = url_for([@ticket.is_open? ? :close : :open, @ticket])
+= simple_form_for @ticket, url: url do |f|
= hidden_ticket_fields
%p.first
- if @ticket.is_open?
%span.label.label-info
%b{style: 'padding:10px'}= t(:open)
- = f.button :loading, t(:close), value: 'close', class: 'btn-mini'
+ = f.button :loading, t(:close), class: 'btn-mini'
- else
%span.label.label-success
%b{style: 'padding:10px'}= t(:closed)
- = f.button :loading, t(:open), value: 'open', class: 'btn-mini'
+ = f.button :loading, t(:open), class: 'btn-mini'
%span.label.label-clear= t(:created_by_on, :user => created_by, :time => @ticket.created_at.to_s(:short)).html_safe
= simple_form_for @ticket do |f|
= hidden_ticket_fields