summaryrefslogtreecommitdiff
path: root/engines/support/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'engines/support/app/views')
-rw-r--r--engines/support/app/views/tickets/new.html.haml18
-rw-r--r--engines/support/app/views/tickets/show.html.haml4
2 files changed, 7 insertions, 15 deletions
diff --git a/engines/support/app/views/tickets/new.html.haml b/engines/support/app/views/tickets/new.html.haml
index 8f217a5..e391499 100644
--- a/engines/support/app/views/tickets/new.html.haml
+++ b/engines/support/app/views/tickets/new.html.haml
@@ -2,22 +2,14 @@
= render 'tickets/tabs'
-- if admin? && @user
- - email = @user.email_address
- - regarding = @user.login
-- elsif logged_in?
- - email = current_user.email_address
- - regarding = current_user.login
+- user = @user if admin?
+- user ||= current_user
= simple_form_for @ticket, :validate => true, :html => {:class => 'form-horizontal'} do |f|
= hidden_ticket_fields
= f.input :subject
- - if logged_in?
- = f.input :email, input_html: {value: email}
- = f.input :regarding_user, input_html: {value: regarding}
- - else
- = f.input :email
- = f.input :regarding_user
+ = f.input :email, input_html: {value: user.email}
+ = f.input :regarding_user, input_html: {value: user.login}
= f.simple_fields_for :comments, @comment do |c|
= c.input :body, :label => t(:description), :as => :text, :input_html => {:class => "full-width", :rows=> 5}
- if admin?
@@ -27,4 +19,4 @@
- if logged_in?
= link_to t(:cancel), auto_tickets_path, :class => :btn
- else
- = link_to t(:cancel), home_path, :class => 'btn' \ No newline at end of file
+ = link_to t(:cancel), home_path, :class => 'btn'
diff --git a/engines/support/app/views/tickets/show.html.haml b/engines/support/app/views/tickets/show.html.haml
index bfdb773..edb6e6f 100644
--- a/engines/support/app/views/tickets/show.html.haml
+++ b/engines/support/app/views/tickets/show.html.haml
@@ -7,6 +7,6 @@
= render :partial => 'tickets/comment', :collection => @ticket.comments
%tr
%td.user
- = logged_in? ? current_user.login : t(:anonymous)
+ = current_user.login || t(:anonymous)
%td.comment
- = render 'tickets/new_comment_form' \ No newline at end of file
+ = render 'tickets/new_comment_form'