summaryrefslogtreecommitdiff
path: root/help/app/controllers
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2012-11-09 13:39:59 -0800
committerjessib <jessib@riseup.net>2012-11-09 13:39:59 -0800
commit90af08d51eb24202bd703bfdfa1d2811fa26a5e0 (patch)
treeaa7346d9d14ce26478c7ef3118685e6c24091fd1 /help/app/controllers
parent215a3a0abce42a1f6d303302763c1d4081cc4685 (diff)
Various very small tweaks: comments about main div display in firefox, give info for when creating unauthenticated tickets, redirecting to index when closing a ticket, fix default select for ticket filtering.
Diffstat (limited to 'help/app/controllers')
-rw-r--r--help/app/controllers/tickets_controller.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/help/app/controllers/tickets_controller.rb b/help/app/controllers/tickets_controller.rb
index 6011232..b76b051 100644
--- a/help/app/controllers/tickets_controller.rb
+++ b/help/app/controllers/tickets_controller.rb
@@ -19,8 +19,10 @@ class TicketsController < ApplicationController
else
@ticket.comments.last.posted_by = nil #hacky, but protecting this attribute doesn't work right, so this should make sure it isn't set.
end
-
flash[:notice] = 'Ticket was successfully created.' if @ticket.save
+ if !logged_in?
+ flash[:notice] = flash[:notice] + ' You can later access this ticket at the url ' + request.protocol + request.host_with_port + ticket_path(@ticket.id) + '. You might want to bookmark this page to find it again. Anybody with this URL will be able to access this ticket, so if you are on a shared computer you might want to remove it from the browser history' #todo
+ end
respond_with(@ticket)
end
@@ -62,7 +64,11 @@ class TicketsController < ApplicationController
end
if @ticket.changed? and @ticket.save
flash[:notice] = 'Ticket was successfully updated.'
- respond_with @ticket
+ if @ticket.is_open
+ respond_with @ticket
+ else #for closed tickets, redirect to index.
+ redirect_to tickets_path
+ end
else
#redirect_to [:show, @ticket] #
flash[:alert] = 'Ticket has not been changed'
@@ -77,6 +83,8 @@ class TicketsController < ApplicationController
#we'll want only tickets that this user can access
# @tickets = Ticket.by_is_open.key(params[:status])
+ #TODO: we will need pagination
+
#below is obviously too messy and not what we want, but wanted to get basic functionality there
if admin?
# todo: for admins, might want option to see tickets they have already posted to. want to use something like tickets_by_admin