summaryrefslogtreecommitdiff
path: root/engines/support/app/views/tickets
diff options
context:
space:
mode:
Diffstat (limited to 'engines/support/app/views/tickets')
-rw-r--r--engines/support/app/views/tickets/_comment.html.haml5
-rw-r--r--engines/support/app/views/tickets/_comments.html.haml8
-rw-r--r--engines/support/app/views/tickets/_edit_form.html.haml32
-rw-r--r--engines/support/app/views/tickets/_new_comment_form.html.haml6
-rw-r--r--engines/support/app/views/tickets/_tabs.html.haml18
-rw-r--r--engines/support/app/views/tickets/edit.html.haml6
-rw-r--r--engines/support/app/views/tickets/index.html.haml10
-rw-r--r--engines/support/app/views/tickets/new.html.haml2
-rw-r--r--engines/support/app/views/tickets/show.html.haml9
9 files changed, 48 insertions, 48 deletions
diff --git a/engines/support/app/views/tickets/_comment.html.haml b/engines/support/app/views/tickets/_comment.html.haml
index 778ca13..65ec394 100644
--- a/engines/support/app/views/tickets/_comment.html.haml
+++ b/engines/support/app/views/tickets/_comment.html.haml
@@ -1,4 +1,5 @@
-- if admin? or !comment.private # only show comment if user is admin or comment is not private
+- # only show comment if user is admin or comment is not private
+- if admin? or !comment.private
%tr
%td.user
%div
@@ -17,4 +18,4 @@
%span.label.label-important
= t(:private)
%td.comment
- = simple_format(comment.body) \ No newline at end of file
+ = simple_format(comment.body)
diff --git a/engines/support/app/views/tickets/_comments.html.haml b/engines/support/app/views/tickets/_comments.html.haml
new file mode 100644
index 0000000..0a3b345
--- /dev/null
+++ b/engines/support/app/views/tickets/_comments.html.haml
@@ -0,0 +1,8 @@
+%table.table.table-striped.table-bordered
+ %tbody
+ = render :partial => 'tickets/comment', :collection => @ticket.comments
+ %tr
+ %td.user
+ = current_user.login || t(:anonymous)
+ %td.comment
+ = render 'tickets/new_comment_form'
diff --git a/engines/support/app/views/tickets/_edit_form.html.haml b/engines/support/app/views/tickets/_edit_form.html.haml
index b8da779..889dac2 100644
--- a/engines/support/app/views/tickets/_edit_form.html.haml
+++ b/engines/support/app/views/tickets/_edit_form.html.haml
@@ -17,34 +17,30 @@
regarding_user_link = ''
end
-= simple_form_for @ticket do |f|
+- url = url_for([@ticket.is_open? ? :close : :open, @ticket])
+= simple_form_for @ticket, url: url do |f|
= hidden_ticket_fields
%p.first
- if @ticket.is_open?
%span.label.label-info
- %b{style: 'padding:10px'}= t(:open)
- = f.button :loading, t(:close), value: 'close', class: 'btn-mini'
+ %b{style: 'padding:10px'}= t("tickets.status.open")
+ = f.button :loading, t("tickets.action.close"), class: 'btn-mini'
- else
%span.label.label-success
- %b{style: 'padding:10px'}= t(:closed)
- = f.button :loading, t(:open), value: 'open', class: 'btn-mini'
- %span.label.label-clear= t(:created_by_on, :user => created_by, :time => @ticket.created_at.to_s(:short)).html_safe
+ %b{style: 'padding:10px'}= t("tickets.status.closed")
+ = f.button :loading, t("tickets.action.open"), class: 'btn-mini'
+ %span.label.label-clear
+ = t("tickets.created_by_on", user: created_by, time: @ticket.created_at.to_s(:short), cascade: true).html_safe
= simple_form_for @ticket do |f|
= hidden_ticket_fields
- %div= t(:subject)
- = f.text_field :subject, :class => 'large full-width'
+ = f.input :subject, input_html: {:class => 'large full-width'}
.row-fluid
.span4
- %div= t(:status)
- = f.select :is_open, [[t(:open), "true"], [t(:closed), "false"]]
+ = f.input :is_open, as: :select, collection: [:true, :false], include_blank: false
.span4
- %div= t(:email)
- = f.text_field :email
+ = f.input :email
.span4
- %div
- = t(:regarding_account)
- = regarding_user_link
- = f.text_field :regarding_user
- = f.button :loading, t(:save), :value => 'save'
+ = f.input :regarding_user, label: Ticket.human_attribute_name(:regarding_user) + regarding_user_link
+ = f.button :loading
- if admin?
- = link_to t(:destroy), auto_ticket_path(@ticket), :confirm => t(:are_you_sure), :method => :delete, :class => 'btn'
+ = destroy_btn t(".destroy", cascade: true), auto_ticket_path(@ticket)
diff --git a/engines/support/app/views/tickets/_new_comment_form.html.haml b/engines/support/app/views/tickets/_new_comment_form.html.haml
index 40c737f..711421d 100644
--- a/engines/support/app/views/tickets/_new_comment_form.html.haml
+++ b/engines/support/app/views/tickets/_new_comment_form.html.haml
@@ -7,7 +7,7 @@
= c.input :body, :label => false, :as => :text, :input_html => {:class => "full-width", :rows=> 5}
- if admin?
= c.input :private, :as => :boolean, :label => false, :inline_label => true
- = f.button :loading, t(:post_reply), class: 'btn-primary', value: 'post_reply'
+ = f.button :loading, t(".post_reply"), class: 'btn-primary', value: 'post_reply'
- if logged_in? && @ticket.is_open
- = f.button :loading, t(:reply_and_close), value: 'reply_and_close'
- = link_to t(:cancel), auto_tickets_path, :class => :btn
+ = f.button :loading, t(".reply_and_close"), value: 'reply_and_close'
+ = btn t(".cancel"), auto_tickets_path
diff --git a/engines/support/app/views/tickets/_tabs.html.haml b/engines/support/app/views/tickets/_tabs.html.haml
index 445a909..7872bb5 100644
--- a/engines/support/app/views/tickets/_tabs.html.haml
+++ b/engines/support/app/views/tickets/_tabs.html.haml
@@ -3,21 +3,17 @@
-#
- unless action?(:new) or action?(:create)
%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')
+ - %w(created updated).each do |order|
+ %li{:class=> ("active" if search_order.start_with? order)}
+ = link_to_order(order)
-#
-# 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'
+ - %w(open closed all).each do |status|
+ %li{:class => ("active" if search_status == status)}
+ = link_to_status status
%li{:class => ("active" if action?(:new) || action?(:create))}
- = link_to icon(:plus, :black) + t(:new_ticket), auto_new_ticket_path
+ = link_to icon(:plus, :black) + t(".new", cascade: true), auto_new_ticket_path
diff --git a/engines/support/app/views/tickets/edit.html.haml b/engines/support/app/views/tickets/edit.html.haml
new file mode 100644
index 0000000..03bda7d
--- /dev/null
+++ b/engines/support/app/views/tickets/edit.html.haml
@@ -0,0 +1,6 @@
+- @show_navigation = params[:user_id].present?
+- @comment = TicketComment.new
+
+.ticket
+ = render 'tickets/edit_form'
+ = render 'tickets/comments'
diff --git a/engines/support/app/views/tickets/index.html.haml b/engines/support/app/views/tickets/index.html.haml
index a4df6e3..526cd6d 100644
--- a/engines/support/app/views/tickets/index.html.haml
+++ b/engines/support/app/views/tickets/index.html.haml
@@ -5,15 +5,15 @@
%table.table.table-striped.table-bordered
%thead
%tr
- %th= t(:subject)
- %th= t(:created)
- %th= t(:updated)
- %th= t(:voices)
+ %th= t(".subject")
+ %th= t(".created")
+ %th= t(".updated")
+ %th= t(".voices")
%tbody
- if @tickets.any?
= render @tickets.all
- else
%tr
- %td{:colspan=>4}= t(:none)
+ %td{:colspan=>4}= t(".none")
= paginate @tickets
diff --git a/engines/support/app/views/tickets/new.html.haml b/engines/support/app/views/tickets/new.html.haml
index 3de5fe9..d3580f9 100644
--- a/engines/support/app/views/tickets/new.html.haml
+++ b/engines/support/app/views/tickets/new.html.haml
@@ -11,7 +11,7 @@
= 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}
+ = c.input :body, :as => :text, :input_html => {:class => "full-width", :rows=> 5}
- if admin?
= c.input :private, :as => :boolean, :label => false, :inline_label => true
= f.button :wrapped, cancel: (logged_in? ? auto_tickets_path : home_path)
diff --git a/engines/support/app/views/tickets/show.html.haml b/engines/support/app/views/tickets/show.html.haml
index 4f3c127..99afa2a 100644
--- a/engines/support/app/views/tickets/show.html.haml
+++ b/engines/support/app/views/tickets/show.html.haml
@@ -2,11 +2,4 @@
.ticket
= render 'tickets/edit_form'
- %table.table.table-striped.table-bordered
- %tbody
- = render :partial => 'tickets/comment', :collection => @ticket.comments
- %tr
- %td.user
- = current_user.login || t(:anonymous)
- %td.comment
- = render 'tickets/new_comment_form'
+ = render 'tickets/comments'