helpdesk 0.0.27 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/helpdesk/admin/tickets.js +1 -6
- data/app/assets/javascripts/helpdesk/application.js +3 -3
- data/app/assets/stylesheets/helpdesk/{admin.css → admin.css.scss} +4 -4
- data/app/assets/stylesheets/helpdesk/admin/bootstrap_overrides.css +1 -1
- data/app/assets/stylesheets/helpdesk/admin/tickets.css +501 -2
- data/app/assets/stylesheets/helpdesk/application.css +2 -2
- data/app/assets/stylesheets/helpdesk/tickets.css.sass +8 -20
- data/app/controllers/helpdesk/admin/base_controller.rb +1 -1
- data/app/controllers/helpdesk/admin/dashboard_controller.rb +1 -1
- data/app/controllers/helpdesk/admin/faqs_controller.rb +1 -1
- data/app/controllers/helpdesk/admin/ticket_types_controller.rb +1 -1
- data/app/controllers/helpdesk/admin/tickets_controller.rb +16 -15
- data/app/controllers/helpdesk/rooter_controller.rb +16 -0
- data/app/controllers/helpdesk/subscribers_controller.rb +2 -16
- data/app/models/helpdesk/faq.rb +1 -1
- data/app/models/helpdesk/subscriber.rb +2 -2
- data/app/views/helpdesk/admin/faqs/_form.html.haml +3 -3
- data/app/views/helpdesk/admin/faqs/new.html.haml +1 -1
- data/app/views/helpdesk/admin/ticket_types/index.html.haml +2 -0
- data/app/views/helpdesk/subscribers/index.html.erb +3 -29
- data/app/views/helpdesk/tickets/_form.html.haml +4 -9
- data/app/views/helpdesk/tickets/_ticket.html.haml +1 -1
- data/app/views/helpdesk/tickets/index.html.haml +1 -1
- data/config/locales/helpdesk.pl.yml +1 -0
- data/config/locales/helpdesk.pt-BR.yml +110 -0
- data/config/routes.rb +9 -4
- data/lib/generators/helpdesk/templates/helpdesk.rb +4 -0
- data/lib/helpdesk.rb +3 -0
- data/lib/helpdesk/engine.rb +1 -1
- data/lib/helpdesk/version.rb +1 -1
- data/lib/route_constraints_faqs.rb +5 -0
- data/lib/route_constraints_tickets.rb +5 -0
- metadata +70 -82
- data/app/assets/stylesheets/helpdesk/imports.css.sass +0 -0
- data/app/views/helpdesk/subscribers/new.html.erb +0 -5
@@ -8,9 +8,9 @@
|
|
8
8
|
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
9
|
* compiled file, but it's generally better to create a new file per style scope.
|
10
10
|
*
|
11
|
-
|
11
|
+
|
12
12
|
*= require_tree .
|
13
|
-
*= require helpdesk/imports
|
14
13
|
*= require helpdesk/admin/bootstrap_overrides
|
15
14
|
*= require helpdesk/admin/tickets
|
15
|
+
*= require_self
|
16
16
|
*/
|
@@ -1,41 +1,29 @@
|
|
1
1
|
|
2
2
|
body
|
3
|
+
div.panel-body
|
4
|
+
min-height: 400px
|
3
5
|
|
4
6
|
form.feedback
|
5
|
-
|
7
|
+
|
6
8
|
> fieldset
|
7
9
|
margin: 0px auto
|
8
10
|
padding: 0px
|
9
11
|
width: 500px
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
|
13
|
+
|
13
14
|
> div
|
14
15
|
clear: both
|
15
16
|
display: block
|
16
|
-
|
17
|
+
|
17
18
|
div.subject input[type=text]
|
18
19
|
float: left
|
19
20
|
width: 350px
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
div.subject
|
24
|
-
select
|
25
|
-
float: right
|
26
|
-
margin: 0px
|
27
|
-
padding: 8px 3px
|
28
|
-
height: 34px
|
29
|
-
width: 110px
|
30
|
-
vertical-align: top
|
31
|
-
font-size: 13px
|
32
|
-
|
33
|
-
|
34
22
|
div.content textarea
|
35
|
-
|
23
|
+
|
36
24
|
> div.content
|
37
25
|
padding-top: 20px
|
38
|
-
|
26
|
+
|
39
27
|
textarea
|
40
28
|
height: 100px
|
41
29
|
width: 482px
|
@@ -2,7 +2,7 @@ class Helpdesk::Admin::FaqsController < Helpdesk::Admin::BaseController
|
|
2
2
|
|
3
3
|
def sort
|
4
4
|
params[:faqs].each_with_index do |id, index|
|
5
|
-
Helpdesk::Faq.
|
5
|
+
Helpdesk::Faq.find(id).update_column(:position, index+1)
|
6
6
|
end
|
7
7
|
render :nothing => true
|
8
8
|
end
|
@@ -47,6 +47,6 @@ class Helpdesk::Admin::TicketTypesController < Helpdesk::Admin::BaseController
|
|
47
47
|
private
|
48
48
|
|
49
49
|
def ticket_type_params
|
50
|
-
params.require(:ticket_type).permit(:active,:position,:title,:tr_class,translations_attributes:[:title])
|
50
|
+
params.require(:ticket_type).permit(:active,:position,:title,:tr_class,translations_attributes:[:title, :id, :locale])
|
51
51
|
end
|
52
52
|
end
|
@@ -1,21 +1,22 @@
|
|
1
1
|
class Helpdesk::Admin::TicketsController < Helpdesk::Admin::BaseController
|
2
2
|
|
3
3
|
def index
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
case params[:tickets]
|
5
|
+
when 'unassigned'
|
6
|
+
@tickets = Helpdesk::Ticket.unassigned
|
7
|
+
when'closed'
|
8
|
+
@tickets = Helpdesk::Ticket.closed
|
9
|
+
when 'active'
|
10
|
+
@tickets = Helpdesk::Ticket.active
|
11
|
+
when 'all'
|
12
|
+
@tickets = Helpdesk::Ticket
|
12
13
|
else
|
13
14
|
@tickets = my_tickets.active
|
14
15
|
end
|
15
16
|
@tickets = @tickets.includes(:requester)
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
.includes(:assignee)
|
18
|
+
.includes(:ticket_type)
|
19
|
+
.page(params[:page])
|
19
20
|
|
20
21
|
render 'list'
|
21
22
|
end
|
@@ -67,10 +68,10 @@ class Helpdesk::Admin::TicketsController < Helpdesk::Admin::BaseController
|
|
67
68
|
end
|
68
69
|
|
69
70
|
|
70
|
-
|
71
|
+
private
|
71
72
|
|
72
|
-
|
73
|
-
|
74
|
-
|
73
|
+
def ticket_params
|
74
|
+
params.require(:ticket).permit(:status,:requester_id,:assignee_id,:ticket_type_id, :subject, :description,comments_attributes:[:author_id, :comment, :public])
|
75
|
+
end
|
75
76
|
|
76
77
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Helpdesk
|
2
|
+
class RooterController < Helpdesk::ApplicationController
|
3
|
+
def index
|
4
|
+
case Helpdesk.root_controller
|
5
|
+
when 'faqs'
|
6
|
+
redirect_to faqs_url
|
7
|
+
when 'tickets'
|
8
|
+
redirect_to tickets_url
|
9
|
+
when 'subscribers'
|
10
|
+
redirect_to subscribers_url
|
11
|
+
else
|
12
|
+
redirect_to faqs_url
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -2,8 +2,9 @@ module Helpdesk
|
|
2
2
|
class SubscribersController < Helpdesk::ApplicationController
|
3
3
|
|
4
4
|
|
5
|
-
def
|
5
|
+
def index
|
6
6
|
@subscriber = Subscriber.new
|
7
|
+
@subscriber.lang = locale
|
7
8
|
|
8
9
|
respond_to do |format|
|
9
10
|
format.html # new.html.erb
|
@@ -25,21 +26,6 @@ module Helpdesk
|
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
|
-
# PUT /subscribers/1
|
29
|
-
# PUT /subscribers/1.json
|
30
|
-
def update
|
31
|
-
@subscriber = Subscriber.find(params[:id])
|
32
|
-
|
33
|
-
respond_to do |format|
|
34
|
-
if @subscriber.update_attributes(subscriber_params)
|
35
|
-
format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }
|
36
|
-
format.json { head :no_content }
|
37
|
-
else
|
38
|
-
format.html { render action: "edit" }
|
39
|
-
format.json { render json: @subscriber.errors, status: :unprocessable_entity }
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
29
|
|
44
30
|
# DELETE /subscribers/1
|
45
31
|
# DELETE /subscribers/1.json
|
data/app/models/helpdesk/faq.rb
CHANGED
@@ -3,7 +3,7 @@ module Helpdesk
|
|
3
3
|
translates :title, :text
|
4
4
|
accepts_nested_attributes_for :translations
|
5
5
|
|
6
|
-
default_scope order('position ASC').includes(:translations)
|
6
|
+
default_scope {order('position ASC').includes(:translations)}
|
7
7
|
|
8
8
|
scope :active, -> {where(active: true)}
|
9
9
|
scope :inactive, -> {where(active: false)}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Helpdesk
|
2
2
|
class Subscriber < ActiveRecord::Base
|
3
|
-
scope :confirmed, where('confirmed = ? ',true)
|
4
|
-
scope :unconfirmed,
|
3
|
+
scope :confirmed, ->{ where('confirmed = ? ',true)}
|
4
|
+
scope :unconfirmed, ->{ where('confirmed = ? ',false)}
|
5
5
|
|
6
6
|
validates_presence_of :email
|
7
7
|
|
@@ -12,9 +12,9 @@
|
|
12
12
|
- I18n.available_locales.each do |locale|
|
13
13
|
%h1
|
14
14
|
= locale
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
= f.globalize_fields_for locale do |g|
|
16
|
+
= g.input :title
|
17
|
+
= g.input :text, :as => :ckeditor, :input_html => { :ckeditor => {:width=>'100%',:height => 200,:toolbar => 'Full'} }
|
18
18
|
|
19
19
|
|
20
20
|
= f.submit 'Save', :class=>'btn btn-primary'
|
@@ -11,6 +11,7 @@
|
|
11
11
|
|
12
12
|
%table.table.table-hover
|
13
13
|
%tr
|
14
|
+
%th Active
|
14
15
|
%th Title
|
15
16
|
%th
|
16
17
|
%th
|
@@ -18,6 +19,7 @@
|
|
18
19
|
|
19
20
|
- @ticket_types.each do |ticket_type|
|
20
21
|
%tr{:class=>ticket_type.tr_class}
|
22
|
+
%td= ticket_type.active
|
21
23
|
%td= ticket_type.title
|
22
24
|
%td= link_to 'Show', admin_ticket_type_path(ticket_type)
|
23
25
|
%td= link_to 'Edit', edit_admin_ticket_type_path(ticket_type)
|
@@ -1,31 +1,5 @@
|
|
1
|
-
<h1>
|
1
|
+
<h1>New subscriber</h1>
|
2
2
|
|
3
|
-
|
4
|
-
<tr>
|
5
|
-
<th>Name</th>
|
6
|
-
<th>Email</th>
|
7
|
-
<th>Lang</th>
|
8
|
-
<th>Hashcode</th>
|
9
|
-
<th>Confirmed</th>
|
10
|
-
<th></th>
|
11
|
-
<th></th>
|
12
|
-
<th></th>
|
13
|
-
</tr>
|
3
|
+
<%= render 'form' %>
|
14
4
|
|
15
|
-
|
16
|
-
<tr>
|
17
|
-
<td><%= subscriber.send Helpdesk.display_user.to_sym %></td>
|
18
|
-
<td><%= subscriber.email %></td>
|
19
|
-
<td><%= subscriber.lang %></td>
|
20
|
-
<td><%= subscriber.hashcode %></td>
|
21
|
-
<td><%= subscriber.confirmed %></td>
|
22
|
-
<td><%= link_to 'Show', subscriber %></td>
|
23
|
-
<td><%= link_to 'Edit', edit_subscriber_path(subscriber) %></td>
|
24
|
-
<td><%= link_to 'Destroy', subscriber, confirm: 'Are you sure?', method: :delete %></td>
|
25
|
-
</tr>
|
26
|
-
<% end %>
|
27
|
-
</table>
|
28
|
-
|
29
|
-
<br />
|
30
|
-
|
31
|
-
<%= link_to 'New Subscriber', new_admin_subscriber_path %>
|
5
|
+
<%= link_to 'Back', subscribers_path %>
|
@@ -8,18 +8,13 @@
|
|
8
8
|
- @ticket.errors.full_messages.each do |msg|
|
9
9
|
%li
|
10
10
|
= msg
|
11
|
-
|
11
|
+
= f.input :subject
|
12
12
|
/ = f.input :ticket_type_id, collection: Helpdesk::TicketType.active, include_blank: false
|
13
|
-
|
14
|
-
%input{:value=>@ticket.subject,:name=>"ticket[subject]",:type => "text",:placeholder => t('helpdesk.tickets.subject')}
|
15
|
-
%select{:name=>"ticket[ticket_type_id]"}
|
16
|
-
- Helpdesk::TicketType.includes(:translations).all.each do |type|
|
17
|
-
%option{:value=>type.id, selected: type.id == @ticket.ticket_type_id}
|
18
|
-
= type.title
|
13
|
+
= f.input :ticket_type_id, collection: Helpdesk::TicketType.active.includes(:translations).all, include_blank: false
|
19
14
|
|
15
|
+
%hr
|
20
16
|
- if @ticket.new_record?
|
21
|
-
|
22
|
-
%textarea{:value=>@ticket.description,:name=>"ticket[description]",:type => "text",:placeholder => t('helpdesk.tickets.description')}
|
17
|
+
= f.input :description,:placeholder => t('helpdesk.tickets.description'),label:false, input_html:{rows:5}
|
23
18
|
- else
|
24
19
|
= @ticket.description
|
25
20
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
- if ticket.requester
|
11
11
|
= ticket.requester.send Helpdesk.display_user.to_sym
|
12
12
|
%td{rowspan:2}
|
13
|
-
= status_label
|
13
|
+
= status_label humanize_with_i18n(ticket.status,'helpdesk.tickets.statuses'), Helpdesk::Ticket::STATUS_CLASS_BY_KEY[ticket.status.to_sym]
|
14
14
|
= ticket.ticket_type.title
|
15
15
|
|
16
16
|
= auto_link(simple_format(ticket.description), :html => { :target => "_blank" })
|
@@ -0,0 +1,110 @@
|
|
1
|
+
pt-BR:
|
2
|
+
|
3
|
+
helpdesk:
|
4
|
+
lang: Idioma
|
5
|
+
Show: Detalhes
|
6
|
+
edit: Editar
|
7
|
+
Destroy: Deletar
|
8
|
+
name: Helpdesk
|
9
|
+
new_ticket: Novo
|
10
|
+
tickets:
|
11
|
+
new: Novo Chamado
|
12
|
+
my: Meu Chamado
|
13
|
+
unassigned: Não atribuido
|
14
|
+
closed: Chamados finalizados
|
15
|
+
all: Todos chamados
|
16
|
+
title: Chamados
|
17
|
+
active: Chamados ativos
|
18
|
+
assignee_to: Atribuido para
|
19
|
+
assign_me: Eu faço isso
|
20
|
+
not_assigned: Não atribuido
|
21
|
+
is_now_assigned: "Chamado %{subject} foi atribuido a você com sucesso"
|
22
|
+
visible_to_autor: Visivel para o autor - enviar um e-mail
|
23
|
+
you_have_no_tickets: "Sem chamados "
|
24
|
+
ticket_closed: Chamados finalizados
|
25
|
+
subject: Assunto
|
26
|
+
description: Conteúdo
|
27
|
+
cancel: cancelar
|
28
|
+
send: Enviar
|
29
|
+
ticket: Chamado
|
30
|
+
faq: FAQ
|
31
|
+
comments:
|
32
|
+
title: Comentários
|
33
|
+
note: Nota
|
34
|
+
send: Enviado
|
35
|
+
received: Recebido
|
36
|
+
note: note
|
37
|
+
author: Re. autor
|
38
|
+
helpdesk: Re.
|
39
|
+
ticket_types:
|
40
|
+
title: Tipos de chamados
|
41
|
+
new: Um novo tipo de chamado
|
42
|
+
all: Todos tipos de chamados
|
43
|
+
active: Tipos ativos de chamados
|
44
|
+
inactive: Tipos inativos de chamados
|
45
|
+
|
46
|
+
dashboard: Dashboard
|
47
|
+
|
48
|
+
subscribers:
|
49
|
+
title: Inscritos
|
50
|
+
confirmed: Inscrição confirmada
|
51
|
+
unconfirmed: Sem confirmação
|
52
|
+
all: Todos inscritos
|
53
|
+
new: Adcionar inscrito
|
54
|
+
|
55
|
+
faqs:
|
56
|
+
title: FAQ
|
57
|
+
active: Questões Ativas
|
58
|
+
inactive: Questões Inativas
|
59
|
+
all: Todas as questões
|
60
|
+
new: Nova questão
|
61
|
+
by: para
|
62
|
+
faq:
|
63
|
+
active: ativo
|
64
|
+
inactive: inativo
|
65
|
+
|
66
|
+
mailer:
|
67
|
+
comment_by_helpdesk_confirmation:
|
68
|
+
title: "Resposta para o chamado foi enviado"
|
69
|
+
re_ticket: "Novo comentário no chamado:"
|
70
|
+
response_content: "Conteúdo do comentário:"
|
71
|
+
comment_by_helpdesk_notification:
|
72
|
+
title: "%{user}, nova resposta recebida para o chamado:"
|
73
|
+
comment_content: "Conteúdo do comentário:"
|
74
|
+
comment_by_requester_notification:
|
75
|
+
title: "Nova resposta recebida para o chamado:"
|
76
|
+
comment_content: "Conteúdo do comentário:"
|
77
|
+
comment_by_requester_confirmation:
|
78
|
+
title: "%{user}, obrigado por enviar um comentário para o chamado"
|
79
|
+
subject: "Novo comentário para o chamado - %{subject}"
|
80
|
+
comment_content: "Conteúdo do comentário:"
|
81
|
+
ticket_created_confirmation:
|
82
|
+
title: "%{user}, obrigado por enviar"
|
83
|
+
subject: "O assunto do seu chamado é:"
|
84
|
+
ticket_content: "Conteúdo do chamado:"
|
85
|
+
info_time: "Obrigado pela solicitação, nós responderemos o mais breve possível."
|
86
|
+
ticket_created_notification:
|
87
|
+
title: "Novo chamado criado"
|
88
|
+
requester_info: "Autor"
|
89
|
+
ticket_content: "O conteúdo do chamado:"
|
90
|
+
ticket_url_title: "Segue link para verificar o andamento do seu chamado:"
|
91
|
+
footer_info: "Esta mensagem foi gerada automaticamente. Não responsa isso. Se você não iniciou uma solicitação de chamado, reporte a nós <a href=\"%{url}\"> clicando aqui </a>."
|
92
|
+
footer_nice: "Tenha um bom dia"
|
93
|
+
|
94
|
+
activerecord:
|
95
|
+
models:
|
96
|
+
Helpdesk: helpdesk
|
97
|
+
helpdesk/ticket: Chamado
|
98
|
+
helpdesk/comment: Comentário
|
99
|
+
attributes:
|
100
|
+
helpdesk/comment:
|
101
|
+
comment: Descrição adcional
|
102
|
+
public: Visivel/Enviar e-mail
|
103
|
+
helpdesk/ticket:
|
104
|
+
requester_id: Solicitante
|
105
|
+
subject: Assunto
|
106
|
+
Status: Status
|
107
|
+
assignee_id: Atribuído
|
108
|
+
ticket_type_id: Tipo da notificação
|
109
|
+
Description: Descrição
|
110
|
+
comments: Mais detalhes
|