summaryrefslogtreecommitdiff
path: root/engines/support/app/views
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-13 13:52:16 +0200
committerAzul <azul@leap.se>2014-05-13 14:02:15 +0200
commit81a4a0527639fe4b560b8d98f977f6dbac67bb41 (patch)
tree725b9effd20be6d9d62e5f0e5443c7e4c5398fcf /engines/support/app/views
parent84ce597ad0516b92d6633c1f81c03517b5d74004 (diff)
prefill ticket form from the model - fixes #5657
email and regarding user fields can be set to defaults based on created_by user. If these fields are emptied by the submitting user they will be set to whereas they are nil if they have not been initialized. In that case we will use meaningful defaults from the user who created the ticket.
Diffstat (limited to 'engines/support/app/views')
-rw-r--r--engines/support/app/views/tickets/_edit_form.html.haml2
-rw-r--r--engines/support/app/views/tickets/new.html.haml4
2 files changed, 3 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 bf175fe..fb279fb 100644
--- a/engines/support/app/views/tickets/_edit_form.html.haml
+++ b/engines/support/app/views/tickets/_edit_form.html.haml
@@ -1,6 +1,6 @@
:ruby
# created by user link
- if @ticket.created_by_user
+ if @ticket.is_creator_validated?
created_by = link_to @ticket.created_by_user.login, @ticket.created_by_user
else
created_by = t(:anonymous)
diff --git a/engines/support/app/views/tickets/new.html.haml b/engines/support/app/views/tickets/new.html.haml
index ab008d2..3de5fe9 100644
--- a/engines/support/app/views/tickets/new.html.haml
+++ b/engines/support/app/views/tickets/new.html.haml
@@ -8,8 +8,8 @@
= simple_form_for @ticket, :validate => true, :html => {:class => 'form-horizontal'} do |f|
= hidden_ticket_fields
= f.input :subject
- = f.input :email, input_html: {value: user.email_address}
- = f.input :regarding_user, input_html: {value: user.login}
+ = f.input :email
+ = f.input :regarding_user
= 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?