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 +4 -4
- data/app/controllers/zendesk_rails/tickets_controller.rb +9 -10
- data/app/views/zendesk_rails/tickets/create.html.erb +11 -0
- data/app/views/zendesk_rails/tickets/show.html.erb +4 -1
- data/config/locales/zendesk_rails.yml +1 -1
- data/lib/zendesk_rails/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 866df6d99d75c7edf8fcff871aaedc2000a10937
|
4
|
+
data.tar.gz: 59a8f8b11fe8a9624286afa6ff50741cf79ba1c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
36
|
+
after_created_ticket @ticket
|
37
37
|
else
|
38
|
-
|
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
|
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
|
-
|
83
|
-
|
84
|
-
|
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"
|
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
|
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.
|
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.
|
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
|