From c96f3544c5e7289eb4157981cc9f680d689d861f Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 4 Jul 2013 01:35:49 -0700 Subject: help - fix ticket navigation & links (use @user, not user). --- app/views/layouts/_header.html.haml | 6 ++++-- app/views/layouts/_navigation.html.haml | 8 ++++---- app/views/layouts/application.html.haml | 2 +- help/app/views/tickets/_order-nav.html.haml | 5 ----- help/app/views/tickets/_status-nav.html.haml | 10 ---------- help/app/views/tickets/_table-nav.html.haml | 4 ---- help/app/views/tickets/_tabs.html.haml | 23 +++++++++++++++++++++++ help/app/views/tickets/index.html.haml | 2 +- help/app/views/tickets/new.html.haml | 15 +++++++++++---- 9 files changed, 44 insertions(+), 31 deletions(-) delete mode 100644 help/app/views/tickets/_order-nav.html.haml delete mode 100644 help/app/views/tickets/_status-nav.html.haml delete mode 100644 help/app/views/tickets/_table-nav.html.haml create mode 100644 help/app/views/tickets/_tabs.html.haml diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 854ab40..b459545 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -4,6 +4,8 @@ = link_to t(:users), users_path %li{:class => ("active" if controller?('tickets') && !params[:user_id])} = link_to t(:tickets), tickets_path -- if user && @show_navigation + %li + = link_to t(:logout), logout_path, :method => :delete +- if @user && @show_navigation .user_heading - = user.email_address + = @user.email_address diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index cbe6d3a..b42c1fe 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -1,6 +1,6 @@ %ul.nav.sidenav - = link_to_navigation t(:overview), user_overview_path(user), :active => controller?(:overviews) - = link_to_navigation t(:account_settings), edit_user_path(user), :active => controller?(:users) - = link_to_navigation t(:email_settings), edit_user_email_settings_path(user), :active => controller?(:email_settings) - = link_to_navigation t(:support_tickets), auto_tickets_path(user), :active => controller?(:tickets) + = link_to_navigation t(:overview), user_overview_path(@user), :active => controller?(:overviews) + = link_to_navigation t(:account_settings), edit_user_path(@user), :active => controller?(:users) + = link_to_navigation t(:email_settings), edit_user_email_settings_path(@user), :active => controller?(:email_settings) + = link_to_navigation t(:support_tickets), auto_tickets_path(@user), :active => controller?(:tickets) = link_to_navigation t(:logout), logout_path, :method => :delete diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index db612b7..d5adca9 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,4 +1,4 @@ -- @show_navigation = true if @show_navigation.nil? +- @show_navigation = true if @show_navigation.nil? && logged_in? !!! %html %head diff --git a/help/app/views/tickets/_order-nav.html.haml b/help/app/views/tickets/_order-nav.html.haml deleted file mode 100644 index b235350..0000000 --- a/help/app/views/tickets/_order-nav.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%ul.nav.nav-pills.pull-right{:style => 'margin-bottom: 0'} - %li{:class=> ("active" if search_order.start_with? 'created_at' )} - = link_to_order('created') - %li{:class=> ("active" if search_order.start_with? 'updated_at' )} - = link_to_order('updated') diff --git a/help/app/views/tickets/_status-nav.html.haml b/help/app/views/tickets/_status-nav.html.haml deleted file mode 100644 index 8e51497..0000000 --- a/help/app/views/tickets/_status-nav.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -%ul.nav.nav-tabs - - if logged_in? - %li{:class => ("active" if search_status == 'open')} - = link_to_status 'open' - %li{:class => ("active" if search_status == 'closed')} - = link_to_status 'closed' - %li{:class => ("active" if search_status == 'all')} - = link_to_status 'all' - %li{:class => ("active" if action?(:new))} - = link_to icon(:plus, :black) + t(:new_ticket), auto_new_ticket_path diff --git a/help/app/views/tickets/_table-nav.html.haml b/help/app/views/tickets/_table-nav.html.haml deleted file mode 100644 index 45ebfb2..0000000 --- a/help/app/views/tickets/_table-nav.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -- unless action?(:new) - = render 'tickets/order-nav' -= render 'tickets/status-nav' - diff --git a/help/app/views/tickets/_tabs.html.haml b/help/app/views/tickets/_tabs.html.haml new file mode 100644 index 0000000..b7b5d3a --- /dev/null +++ b/help/app/views/tickets/_tabs.html.haml @@ -0,0 +1,23 @@ +-# +-# SORT ORDER TABS +-# +- unless action?(:new) + %ul.nav.nav-pills.pull-right.slim + %li{:class=> ("active" if search_order.start_with? 'created_at')} + = link_to_order('created') + %li{:class=> ("active" if search_order.start_with? 'updated_at')} + = link_to_order('updated') + +-# +-# STATUS FILTER TABS +-# +%ul.nav.nav-tabs + - if logged_in? + %li{:class => ("active" if search_status == 'open')} + = link_to_status 'open' + %li{:class => ("active" if search_status == 'closed')} + = link_to_status 'closed' + %li{:class => ("active" if search_status == 'all')} + = link_to_status 'all' + %li{:class => ("active" if action?(:new))} + = link_to icon(:plus, :black) + t(:new_ticket), auto_new_ticket_path diff --git a/help/app/views/tickets/index.html.haml b/help/app/views/tickets/index.html.haml index 1b32dc1..c02a326 100644 --- a/help/app/views/tickets/index.html.haml +++ b/help/app/views/tickets/index.html.haml @@ -1,6 +1,6 @@ - @show_navigation = !params[:user_id].nil? -= render 'tickets/table-nav' += render 'tickets/tabs' %table.table.table-striped.table-bordered %thead diff --git a/help/app/views/tickets/new.html.haml b/help/app/views/tickets/new.html.haml index 04b091c..4d35659 100644 --- a/help/app/views/tickets/new.html.haml +++ b/help/app/views/tickets/new.html.haml @@ -1,13 +1,20 @@ - @show_navigation = !params[:user_id].nil? -= render 'tickets/table-nav' += 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 = simple_form_for @ticket, :validate => true, :html => {:class => 'form-horizontal'} do |f| = hidden_ticket_fields = f.input :title, :label => t(:subject) - - if user - = f.input :email, input_html: {value: user.email_address} - = f.input :regarding_user, input_html: {value: user.login} + - 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 -- cgit v1.2.3