summaryrefslogtreecommitdiff
path: root/help/app/views
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-01-14 11:19:55 -0800
committerjessib <jessib@leap.se>2013-01-14 11:19:55 -0800
commit2485527650c4832d764d318e91c10bafde8b8ae5 (patch)
treeb624178d9d6e3279f38340e86d2097a338b434d6 /help/app/views
parentce8b283255e2be4c0f42b3223c3cf4ad33364933 (diff)
Some fixes to the how we keep track of information about users associated with a ticket.
Diffstat (limited to 'help/app/views')
-rw-r--r--help/app/views/tickets/_comment.html.haml6
-rw-r--r--help/app/views/tickets/_ticket_data.html.haml18
-rw-r--r--help/app/views/tickets/new.html.haml2
3 files changed, 13 insertions, 13 deletions
diff --git a/help/app/views/tickets/_comment.html.haml b/help/app/views/tickets/_comment.html.haml
index ae7f1d4..01cf01a 100644
--- a/help/app/views/tickets/_comment.html.haml
+++ b/help/app/views/tickets/_comment.html.haml
@@ -2,10 +2,10 @@
- if admin? or !comment.private # only show comment if user is admin or comment is not private
%tr
%td
- - if commenter = User.find(comment.posted_by)
+ - if comment.posted_by_user
%b
- = 'Posted by' + (commenter.is_admin? ? ' admin' : '') + ':'
- = commenter.login
+ = 'Posted by' + (comment.posted_by_user.is_admin? ? ' admin' : '') + ':'
+ = comment.posted_by_user.login
- else
Unauthenticated post
- if comment.private
diff --git a/help/app/views/tickets/_ticket_data.html.haml b/help/app/views/tickets/_ticket_data.html.haml
index fd5d3bf..2261d8f 100644
--- a/help/app/views/tickets/_ticket_data.html.haml
+++ b/help/app/views/tickets/_ticket_data.html.haml
@@ -1,20 +1,20 @@
.spam12
%b
Created by:
- - if creator = User.find(@ticket.created_by)
- - if !creator.is_admin?
- = link_to creator.login, edit_user_path(creator)
- - else
- = creator.login
+ - if @ticket.created_by_user
+ = link_to @ticket.created_by_user.login, edit_user_path(@ticket.created_by_user) #todo: won't want edit path
- else
Unauthenticated ticket creator
- if @ticket.regarding_user
%b
Regarding user:
- - if regarding_user = User.find_by_login(@ticket.regarding_user)
- = link_to @ticket.regarding_user, edit_user_path(regarding_user)
- - else
- = @ticket.regarding_user + '(no such user)'
+ - if admin?
+ - if @ticket.regarding_user_actual_user
+ = link_to @ticket.regarding_user_actual_user.login, edit_user_path(@ticket.regarding_user_actual_user) #todo: won't want edit path
+ - else
+ = @ticket.regarding_user + ' (no such user)'
+ - else # a non-admin is viewing the ticket, so they shouldn't see confirmation of whether the regarding_user exists or not.
+ = @ticket.regarding_user
- if @ticket.email
%b
email:
diff --git a/help/app/views/tickets/new.html.haml b/help/app/views/tickets/new.html.haml
index 79a9af7..af8baad 100644
--- a/help/app/views/tickets/new.html.haml
+++ b/help/app/views/tickets/new.html.haml
@@ -3,7 +3,7 @@
= simple_form_for(@ticket, :html => {:novalidate => true}) do |f| #turn off html5 validations to test
= f.input :title
= f.input :email if !current_user #hmm--might authenticated users want to submit an alternate email?
- = f.input :regarding_user if !current_user
+ = f.input :regarding_user
= render :partial => 'new_comment', :locals => {:f => f}
.form-actions
= f.button :submit, :class => 'btn-primary'