summaryrefslogtreecommitdiff
path: root/help/app/views
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-06-23 22:14:45 -0700
committerelijah <elijah@riseup.net>2013-07-04 04:04:54 -0700
commitd121373b7c21a29e47708e8b67aeb964202e52c5 (patch)
tree92ea7dda1a3c7173785f19f0844cd637984f2924 /help/app/views
parent38544a07de7988eee91343c1491dae1e08ce5034 (diff)
fix several issues with tickets: js error, when to redirect, navigation, localization.
Diffstat (limited to 'help/app/views')
-rw-r--r--help/app/views/tickets/_comment.html.haml4
-rw-r--r--help/app/views/tickets/_edit_form.html.haml10
-rw-r--r--help/app/views/tickets/_new_comment_form.html.haml5
-rw-r--r--help/app/views/tickets/_status-nav.html.haml13
-rw-r--r--help/app/views/tickets/new.html.haml3
5 files changed, 17 insertions, 18 deletions
diff --git a/help/app/views/tickets/_comment.html.haml b/help/app/views/tickets/_comment.html.haml
index c02246c..4252eee 100644
--- a/help/app/views/tickets/_comment.html.haml
+++ b/help/app/views/tickets/_comment.html.haml
@@ -6,9 +6,9 @@
- if comment.posted_by_user
= comment.posted_by_user.login
- else
- = t(:unknown)
+ = t(:anonymous)
%div= comment.posted_at.to_s(:short)
- - if comment.posted_by_user.is_admin?
+ - if comment.posted_by_user && comment.posted_by_user.is_admin?
%div
%span.label.label-inverse
= t(:admin)
diff --git a/help/app/views/tickets/_edit_form.html.haml b/help/app/views/tickets/_edit_form.html.haml
index 3d1d879..151d6f1 100644
--- a/help/app/views/tickets/_edit_form.html.haml
+++ b/help/app/views/tickets/_edit_form.html.haml
@@ -20,8 +20,7 @@
- else
%span.label.label-success= t(:closed)
%span.label.label-clear= t(:created_by_on, :user => created_by, :time => @ticket.created_at.to_s(:short)).html_safe
- = t(:subject)
- %br
+ %div= t(:subject)
= f.text_field :title, :class => 'large full-width'
.row-fluid
.span4
@@ -32,15 +31,14 @@
= f.text_field :email
.span4
%div
- = t(:regarding)
+ = t(:regarding_account)
= regarding_user_link
= f.text_field :regarding_user
= f.submit t(:save), :class => 'btn'
- if @ticket.is_open?
= f.submit t(:close), :class => 'btn'
- =# button_to t(:close), {:post => {:is_open => false}}, :method => :put, :class => 'btn'
- else
= f.submit t(:open), :class => 'btn'
- =# button_to t(:open), {:post => {:is_open => true}}, :method => :put, :class => 'btn'
-
+ - if admin?
+ = link_to t(:destroy), ticket_path, :confirm => 'are you sure?', :method => :delete, :class => 'btn'
diff --git a/help/app/views/tickets/_new_comment_form.html.haml b/help/app/views/tickets/_new_comment_form.html.haml
index b273503..de54259 100644
--- a/help/app/views/tickets/_new_comment_form.html.haml
+++ b/help/app/views/tickets/_new_comment_form.html.haml
@@ -7,7 +7,6 @@
- if admin?
= c.input :private, :as => :boolean, :label => false, :inline_label => true
= f.button :submit, t(:post_reply), :class => 'btn-primary'
- - if @ticket.is_open
+ - if logged_in? && @ticket.is_open
= f.button :submit, t(:reply_and_close)
- = link_to t(:destroy), ticket_path, :confirm => 'are you sure?', :method => :delete, :class => 'btn btn-danger' if admin?
- = link_to t(:cancel), tickets_path, :class => :btn
+ = link_to t(:cancel), tickets_path, :class => :btn
diff --git a/help/app/views/tickets/_status-nav.html.haml b/help/app/views/tickets/_status-nav.html.haml
index e1dca84..c8279ed 100644
--- a/help/app/views/tickets/_status-nav.html.haml
+++ b/help/app/views/tickets/_status-nav.html.haml
@@ -1,9 +1,10 @@
%ul.nav.nav-tabs
- %li{:class => ("active" if status == 'open')}
- = link_to_status 'open'
- %li{:class => ("active" if status == 'closed')}
- = link_to_status 'closed'
- %li{:class => ("active" if status == 'all')}
- = link_to_status 'all'
+ - if logged_in?
+ %li{:class => ("active" if status == 'open')}
+ = link_to_status 'open'
+ %li{:class => ("active" if status == 'closed')}
+ = 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/new.html.haml b/help/app/views/tickets/new.html.haml
index acb9537..7d3f76c 100644
--- a/help/app/views/tickets/new.html.haml
+++ b/help/app/views/tickets/new.html.haml
@@ -14,4 +14,5 @@
= c.input :private, :as => :boolean, :label => false, :inline_label => true
.form-actions
= f.button :submit, :class => 'btn-primary'
- = link_to t(:cancel), tickets_path, :class => :btn
+ - if logged_in?
+ = link_to t(:cancel), tickets_path, :class => :btn