summaryrefslogtreecommitdiff
path: root/help/app
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-06-17 01:27:01 -0700
committerelijah <elijah@riseup.net>2013-07-04 03:57:59 -0700
commit7d58f640e89a89a4767e59883b864afcd4e9dad4 (patch)
tree5ddb5705c2062931c3e9478b8e6440150deaf4e1 /help/app
parent3f51128e24e1ca3247169066aa6a03090df98dd6 (diff)
new ui - ticket navigation
Diffstat (limited to 'help/app')
-rw-r--r--help/app/helpers/tickets_helper.rb20
-rw-r--r--help/app/views/tickets/_order-nav.html.haml2
-rw-r--r--help/app/views/tickets/_status-nav.html.haml2
-rw-r--r--help/app/views/tickets/_table-nav.html.haml9
-rw-r--r--help/app/views/tickets/index.html.haml23
-rw-r--r--help/app/views/tickets/new.html.haml25
6 files changed, 48 insertions, 33 deletions
diff --git a/help/app/helpers/tickets_helper.rb b/help/app/helpers/tickets_helper.rb
index bd2c069..8b4ff71 100644
--- a/help/app/helpers/tickets_helper.rb
+++ b/help/app/helpers/tickets_helper.rb
@@ -1,7 +1,7 @@
module TicketsHelper
def status
- params[:open_status] || 'open'
+ params[:open_status]
end
def admin
@@ -14,8 +14,14 @@ module TicketsHelper
end
def link_to_status(new_status)
- label = new_status + ' issues'
- link_to label, :open_status => new_status, :admin_status => admin, :sort_order => order
+ if new_status == "open"
+ label = t(:open_tickets)
+ elsif new_status == "closed"
+ label = t(:closed_tickets)
+ elsif new_status == "all"
+ label = t(:all_tickets)
+ end
+ link_to label, tickets_path(:open_status => new_status, :admin_status => admin, :sort_order => order)
end
def link_to_order(order_field)
@@ -35,8 +41,14 @@ module TicketsHelper
direction = 'desc'
end
+ if order_field == 'updated'
+ label = t(:updated)
+ elsif order_field == 'created'
+ label = t(:created)
+ end
+
link_to :sort_order => order_field + '_at_' + direction, :open_status => status, :admin_status => admin do
- arrow + order_field + ' at'
+ arrow + label
end
end
diff --git a/help/app/views/tickets/_order-nav.html.haml b/help/app/views/tickets/_order-nav.html.haml
index 9e8bcee..a2ddb72 100644
--- a/help/app/views/tickets/_order-nav.html.haml
+++ b/help/app/views/tickets/_order-nav.html.haml
@@ -1,4 +1,4 @@
-%ul.nav.nav-pills.pull-right
+%ul.nav.nav-pills.pull-right{:style => 'margin-bottom: 0'}
%li{:class=> ("active" if order.start_with? 'created_at' )}
= link_to_order('created')
%li{:class=> ("active" if order.start_with? 'updated_at' )}
diff --git a/help/app/views/tickets/_status-nav.html.haml b/help/app/views/tickets/_status-nav.html.haml
index 69f4248..e1dca84 100644
--- a/help/app/views/tickets/_status-nav.html.haml
+++ b/help/app/views/tickets/_status-nav.html.haml
@@ -5,3 +5,5 @@
= link_to_status 'closed'
%li{:class => ("active" if status == 'all')}
= link_to_status 'all'
+ %li{:class => ("active" if action?(:new))}
+ = link_to icon(:plus, :black) + t(:new_ticket), new_ticket_path
diff --git a/help/app/views/tickets/_table-nav.html.haml b/help/app/views/tickets/_table-nav.html.haml
index 635b59b..45ebfb2 100644
--- a/help/app/views/tickets/_table-nav.html.haml
+++ b/help/app/views/tickets/_table-nav.html.haml
@@ -1,5 +1,4 @@
-.row
- .span6
- = render 'tickets/status-nav'
- .span4
- = render 'tickets/order-nav'
+- unless action?(:new)
+ = render 'tickets/order-nav'
+= render 'tickets/status-nav'
+
diff --git a/help/app/views/tickets/index.html.haml b/help/app/views/tickets/index.html.haml
index 23a503d..a3cbfcf 100644
--- a/help/app/views/tickets/index.html.haml
+++ b/help/app/views/tickets/index.html.haml
@@ -1,17 +1,12 @@
-%h1 tickets index
+- if admin?
+ = render 'tickets/admin-nav'
-Create a
-= link_to "new ticket", new_ticket_path
+= render 'tickets/table-nav'
+
+%table.table-striped.table-bordered.table-hover
+ //{:style => "width:100%;"}
+ %tbody
+ = render @tickets.all
+= paginate @tickets
-= #%div{"data-pjax-container" => ""} # not sure how to get this working right
-.row
- .span2
- - if admin?
- = render 'tickets/admin-nav'
- .span10
- = render 'tickets/table-nav'
- %table.table-striped.table-bordered.table-hover{:style => "width:100%;"}
- %tbody
- = render @tickets.all
- = paginate @tickets
diff --git a/help/app/views/tickets/new.html.haml b/help/app/views/tickets/new.html.haml
index 1aa689b..5442910 100644
--- a/help/app/views/tickets/new.html.haml
+++ b/help/app/views/tickets/new.html.haml
@@ -1,10 +1,17 @@
-.span12
- %h2=t :new_ticket
- = simple_form_for @ticket, :validate => true, :html => {:class => 'form-horizontal'} do |f|
- = f.input :title
- = f.input :email if !current_user #hmm--might authenticated users want to submit an alternate email?
+
+//%h2.first= t :new_ticket
+
+= render 'tickets/table-nav'
+
+= simple_form_for @ticket, :validate => true, :html => {:class => 'form-horizontal'} do |f|
+ = f.input :title
+ - if user
+ = f.input :email, input_html: {value: user.email_address}
+ = f.input :regarding_user, input_html: {value: user.login}
+ - else
+ = f.input :email
= f.input :regarding_user
- = render :partial => 'new_comment', :locals => {:f => f}
- .form-actions
- = f.button :submit, :class => 'btn-primary'
- = link_to t(:cancel), tickets_path, :class => :btn
+ = render :partial => 'new_comment', :locals => {:f => f}
+ .form-actions
+ = f.button :submit, :class => 'btn-primary'
+ = link_to t(:cancel), tickets_path, :class => :btn