diff options
author | azul <azul@riseup.net> | 2014-04-25 12:15:37 +0200 |
---|---|---|
committer | azul <azul@riseup.net> | 2014-04-25 12:15:37 +0200 |
commit | 76ad25ba0ee344f185f8e8cdfe066685cd3b0447 (patch) | |
tree | d8122b5b5144c917f5e1924c1428a3a871e94149 /engines/support/app/views | |
parent | 2b6200f508ddb8e1c8a76fd3778881c39d787d8d (diff) | |
parent | be81b7430e0a2046125be7c3a4b01b8725f4afe6 (diff) |
Merge pull request #148 from azul/feature/api-quota-support
Feature/api quota support + current_user null pattern
Diffstat (limited to 'engines/support/app/views')
-rw-r--r-- | engines/support/app/views/tickets/new.html.haml | 16 | ||||
-rw-r--r-- | engines/support/app/views/tickets/show.html.haml | 2 |
2 files changed, 5 insertions, 13 deletions
diff --git a/engines/support/app/views/tickets/new.html.haml b/engines/support/app/views/tickets/new.html.haml index ba86ac3..65ed67b 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_address} + = 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? diff --git a/engines/support/app/views/tickets/show.html.haml b/engines/support/app/views/tickets/show.html.haml index bbca4bf..4f3c127 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' |