From bf80482c34034a59307193ced0dcfac7db05f055 Mon Sep 17 00:00:00 2001 From: jessib Date: Mon, 31 Dec 2012 13:05:39 -0800 Subject: Client-side validations, including only validating email address format if something is input for email address. --- help/app/views/tickets/_new_comment.html.haml | 2 +- help/app/views/tickets/new.html.haml | 2 +- help/app/views/tickets/show.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'help/app/views/tickets') diff --git a/help/app/views/tickets/_new_comment.html.haml b/help/app/views/tickets/_new_comment.html.haml index 7307dad..31d134f 100644 --- a/help/app/views/tickets/_new_comment.html.haml +++ b/help/app/views/tickets/_new_comment.html.haml @@ -1,2 +1,2 @@ = f.simple_fields_for :comments, @comment do |c| - = c.input :body, :label => 'Comment', :as => :text, :input_html => {:class => "span12", :rows=>4} + = c.input :body, :label => 'Comment', :as => :text, :input_html => {:class => "span9", :rows=>4} diff --git a/help/app/views/tickets/new.html.haml b/help/app/views/tickets/new.html.haml index 750b990..ee7adb2 100644 --- a/help/app/views/tickets/new.html.haml +++ b/help/app/views/tickets/new.html.haml @@ -1,6 +1,6 @@ .span12 %h2=t :new_ticket - = simple_form_for(@ticket, :html => {:novalidate => true}) do |f| #turn off html5 validations to test + = 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? = render :partial => 'new_comment', :locals => {:f => f} diff --git a/help/app/views/tickets/show.html.haml b/help/app/views/tickets/show.html.haml index 3f00b35..a69048b 100644 --- a/help/app/views/tickets/show.html.haml +++ b/help/app/views/tickets/show.html.haml @@ -8,7 +8,7 @@ = render(:partial => "comment", :collection => @ticket.comments) = #render @ticket.comments should work if view is in /app/views/comments/_comment - = simple_form_for(@ticket, :html => {:novalidate => true}) do |f| #turn off html5 validations to test + = simple_form_for @ticket, :html => {:class => 'form-horizontal'} do |f| # don't need validations so long as this is so simple = render :partial => 'new_comment', :locals => {:f => f} .span10.offset3 = f.button :submit, @post_reply_str, :class => 'btn-primary' -- cgit v1.2.3 From fd62997599f327c0153e23c9f8d2b074a83b43a7 Mon Sep 17 00:00:00 2001 From: jessib Date: Mon, 31 Dec 2012 13:16:01 -0800 Subject: Small CSS tweak --- help/app/views/tickets/_comment.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'help/app/views/tickets') diff --git a/help/app/views/tickets/_comment.html.haml b/help/app/views/tickets/_comment.html.haml index 26794dc..1d8ee41 100644 --- a/help/app/views/tickets/_comment.html.haml +++ b/help/app/views/tickets/_comment.html.haml @@ -6,7 +6,8 @@ = 'Posted by' + (commenter.is_admin? ? ' admin' : '') + ':' = commenter.login - else - Unauthenticated post + %b + Unauthenticated post .pull-right %b Posted at: -- cgit v1.2.3 From a9ef046a596b5876792b1cc4ab0d26b9b255c342 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 14 Jan 2013 16:24:25 +0100 Subject: tickets controller tests passing --- help/app/views/tickets/_ticket_data.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'help/app/views/tickets') diff --git a/help/app/views/tickets/_ticket_data.html.haml b/help/app/views/tickets/_ticket_data.html.haml index 3d301be..fee080f 100644 --- a/help/app/views/tickets/_ticket_data.html.haml +++ b/help/app/views/tickets/_ticket_data.html.haml @@ -22,4 +22,4 @@ = button_to 'Close', {:post => {:is_open => false}}, :method => :put, :class => 'btn btn-small' - else = 'closed' - = button_to 'Open', {:post => {:is_open => true}}, :method => :put, :class => 'btn btn-small' \ No newline at end of file + = button_to 'Open', {:post => {:is_open => true}}, :method => :put, :class => 'btn btn-small' -- cgit v1.2.3 From 8141876126aa25d713cf4b2c76c3ecff837c4ba7 Mon Sep 17 00:00:00 2001 From: jessib Date: Mon, 14 Jan 2013 12:39:59 -0800 Subject: Use partials for displaying details shown when viewing a user. Some of these partials have specific CSS for another use, so we will likely want to tweak this. --- help/app/views/tickets/_ticket.html.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'help/app/views/tickets') diff --git a/help/app/views/tickets/_ticket.html.haml b/help/app/views/tickets/_ticket.html.haml index 3edfa8b..e02aaeb 100644 --- a/help/app/views/tickets/_ticket.html.haml +++ b/help/app/views/tickets/_ticket.html.haml @@ -1,3 +1,4 @@ += # TODO---this is now used in 2 places, and not sure we want the same CSS in both places %tr %td %b @@ -5,9 +6,9 @@ %br %small created: - = ticket.created_at.to_s(:short) + = ticket.created_at.to_s(:short) #todo doesn't show year updated: - = ticket.updated_at.to_s(:short) + = ticket.updated_at.to_s(:short) # doesn't show year %small.pull-right comments by: = ticket.commenters -- cgit v1.2.3 From 9d53f7b2d1b34da6b6103e97bd6c931cedb23e9b Mon Sep 17 00:00:00 2001 From: jessib Date: Tue, 15 Jan 2013 11:03:02 -0800 Subject: Show different ticket characteristics when viewing the users versus when listing the tickets. Give a message if a user has no tickets. --- help/app/views/tickets/_ticket.html.haml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'help/app/views/tickets') diff --git a/help/app/views/tickets/_ticket.html.haml b/help/app/views/tickets/_ticket.html.haml index e02aaeb..7b37652 100644 --- a/help/app/views/tickets/_ticket.html.haml +++ b/help/app/views/tickets/_ticket.html.haml @@ -1,14 +1,17 @@ -= # TODO---this is now used in 2 places, and not sure we want the same CSS in both places +- updated_at_text = 'updated: ' + ticket.updated_at.to_s(:long) %tr %td %b = link_to ticket.title, ticket - %br - %small - created: - = ticket.created_at.to_s(:short) #todo doesn't show year - updated: - = ticket.updated_at.to_s(:short) # doesn't show year - %small.pull-right - comments by: - = ticket.commenters + - if params[:controller] == 'tickets' + %br + %small + created: + = ticket.created_at.to_s(:long) + = updated_at_text + %small.pull-right + comments by: + = ticket.commenters + - else + %small + = updated_at_text \ No newline at end of file -- cgit v1.2.3