zendesk_rails 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5fb96a52344222e9e1a3adb8b563ae2241a14eb
4
- data.tar.gz: 155198622fa584c50f53ed0d8bf68401cc05614d
3
+ metadata.gz: 866df6d99d75c7edf8fcff871aaedc2000a10937
4
+ data.tar.gz: 59a8f8b11fe8a9624286afa6ff50741cf79ba1c1
5
5
  SHA512:
6
- metadata.gz: 893f78bd0719115cc8a2a66e02f4058b1e2284e45be1654a1f96aba6d9d9fe4bac75860dba708bc3293427394350993737d9fa0ff22b49a0628b42c755e5f0f1
7
- data.tar.gz: f9d185c480227309bc0c854b16d4fa0b20874fb29f8bfcc5de5ac66fc2e7575cc1c590b920028645bb213414dab9a844b3394d476def2ee983fbdf5ab96d2403
6
+ metadata.gz: a2d0e415c3a8c5f3724cdb896d99df246615df2ce30a973a5b9e3919f630cc2e193ce867f39c89513aeb949cf28477cf90b67fd165ece03050197b0bd16f08f5
7
+ data.tar.gz: c8407ee8bbcfbea294d04fbae33e5a30b559fad866c5755160f3d745f6f30af95243712916a6e1ab35186301c829d1b234447860991f6297b011f07f7eff7cb0
@@ -33,9 +33,9 @@ module ZendeskRails
33
33
  @handler = Ticket.new(ticket_params)
34
34
 
35
35
  if @ticket = @handler.create
36
- after_created_ticket(@ticket)
36
+ after_created_ticket @ticket
37
37
  else
38
- after_invalid_ticket(@ticket)
38
+ render 'new'
39
39
  end
40
40
  end
41
41
 
@@ -44,7 +44,7 @@ module ZendeskRails
44
44
  @comment = Comment.new(@ticket, comment_params)
45
45
 
46
46
  if @comment.save
47
- after_updated_ticket(@ticket)
47
+ after_updated_ticket @ticket
48
48
  else
49
49
  render 'show'
50
50
  end
@@ -79,18 +79,17 @@ module ZendeskRails
79
79
  end
80
80
 
81
81
  def after_created_ticket ticket
82
- key = zendesk_user_signed_in? ? :authenticated : :unauthenticated
83
- message = t "zendesk.tickets.create.#{key}.message"
84
- redirect_to ticket_path(ticket.id), flash: { notice: message }
82
+ if zendesk_user_signed_in?
83
+ message = t "zendesk.tickets.create.authenticated.message"
84
+ redirect_to ticket_path(ticket.id), flash: { notice: message }
85
+ else
86
+ render 'create'
87
+ end
85
88
  end
86
89
 
87
90
  def after_updated_ticket ticket
88
91
  message = t 'zendesk.comments.added'
89
92
  redirect_to ticket_path(ticket.id), flash: { notice: message }
90
93
  end
91
-
92
- def after_invalid_ticket ticket
93
- render 'new'
94
- end
95
94
  end
96
95
  end
@@ -0,0 +1,11 @@
1
+ <div class="alert alert-success">
2
+ <%= raw t('zendesk.tickets.create.unauthenticated.message', email: @ticket.requester.email) %>
3
+ </div>
4
+
5
+ <div class="page-header">
6
+ <h2><%= truncate @ticket.subject, length: 200 -%></h2>
7
+ </div>
8
+
9
+ <div class="zendesk-comment">
10
+ <%= @ticket.description %>
11
+ </div>
@@ -24,7 +24,10 @@
24
24
  </div>
25
25
  <% end %>
26
26
  <div class="<%= photo ? 'col-xs-10 col-md-11' : 'col-md-12' %>">
27
- <div class="zendesk-comment-body"><%= raw comment.html_body %></div>
27
+ <div class="zendesk-comment-body">
28
+ <%= raw comment.html_body %>
29
+ </div>
30
+
28
31
  <small class="zendesk-comment-details">
29
32
  <%= t 'zendesk.comments.details', time: format_time(comment.created_at), user: comment.author.name %>
30
33
  </small>
@@ -43,7 +43,7 @@ en:
43
43
  authenticated:
44
44
  message: Thank you for your submission! You can track the status of your ticket from this page.
45
45
  unauthenticated:
46
- message: Thank you for your submission! You will receive an email at the provided address shortly.
46
+ message: Thank you for your submission! You will receive an email at <strong>%{email}</strong> shortly.
47
47
  comments:
48
48
  details: '%{time} by %{user}'
49
49
  added: Comment successfully submitted.
@@ -1,3 +1,3 @@
1
1
  module ZendeskRails
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Zane
@@ -142,6 +142,7 @@ files:
142
142
  - app/views/layouts/zendesk_rails/tickets.html.erb
143
143
  - app/views/zendesk_rails/tickets/_comment_form.html.erb
144
144
  - app/views/zendesk_rails/tickets/_form.html.erb
145
+ - app/views/zendesk_rails/tickets/create.html.erb
145
146
  - app/views/zendesk_rails/tickets/index.html.erb
146
147
  - app/views/zendesk_rails/tickets/new.html.erb
147
148
  - app/views/zendesk_rails/tickets/show.html.erb