summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/views/home/index.html.haml11
-rw-r--r--app/views/layouts/application.html.haml2
-rw-r--r--help/app/controllers/tickets_controller.rb12
-rw-r--r--help/app/views/tickets/index.html.haml6
-rw-r--r--help/app/views/tickets/show.html.haml4
5 files changed, 23 insertions, 12 deletions
diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml
index 9e68674..dd7e5aa 100644
--- a/app/views/home/index.html.haml
+++ b/app/views/home/index.html.haml
@@ -1,11 +1,14 @@
+%h1 spacer for firefox
+%h1 spacer for firefox
Try to fetch a
= link_to "cert", cert_path
%p
-Try to create a
+Create a
= link_to "ticket", new_ticket_path
-%p
-See all
-= link_to "tickets", tickets_path
+- if logged_in?
+ %p
+ See all
+ = link_to "tickets", tickets_path
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index e6d22f0..e3b7977 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -18,6 +18,6 @@
.content
.row
.span12
- = render 'layouts/messages'
+ = render 'layouts/messages' # TODO: In firefox, these are hidden by header
= yield
%footer
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
diff --git a/help/app/views/tickets/index.html.haml b/help/app/views/tickets/index.html.haml
index 8fe4055..5e35b12 100644
--- a/help/app/views/tickets/index.html.haml
+++ b/help/app/views/tickets/index.html.haml
@@ -3,12 +3,12 @@ Create a
= link_to "new ticket", new_ticket_path
= # below shouldn't be unless logged in
%h2 Tickets
-= form_tag (tickets_path, :method => :get) do # want to redo as ajax, and make sure it displays the selected option
- - options = ["open", "closed", "all"]
+= form_tag(tickets_path, :method => :get) do # want to redo as ajax, and make sure it displays the selected option
+ - options = ["all", "open", "closed"]
- if admin?
- options << "open tickets I admin" # obviously not what we will want
- options << "all tickets I admin" # obviously not what we will want
- = select_tag :status, options_for_select(options) # TODO
+ = select_tag :status, options_for_select(options, :selected => params[:status]|| "all")
= submit_tag "filter"
- @tickets.each do |ticket|
%p
diff --git a/help/app/views/tickets/show.html.haml b/help/app/views/tickets/show.html.haml
index 77d168a..9b12f34 100644
--- a/help/app/views/tickets/show.html.haml
+++ b/help/app/views/tickets/show.html.haml
@@ -1,5 +1,5 @@
-%h1 tickets show (just as space)
-%h1 tickets show (just as space)
+%h1 tickets show (just as space for firefox)
+%h1 tickets show (just as space for firefox)
%h2= @ticket.title
- if @ticket.email
email: