helpdesk 0.0.27 → 0.0.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/helpdesk/admin/tickets.js +1 -6
  3. data/app/assets/javascripts/helpdesk/application.js +3 -3
  4. data/app/assets/stylesheets/helpdesk/{admin.css → admin.css.scss} +4 -4
  5. data/app/assets/stylesheets/helpdesk/admin/bootstrap_overrides.css +1 -1
  6. data/app/assets/stylesheets/helpdesk/admin/tickets.css +501 -2
  7. data/app/assets/stylesheets/helpdesk/application.css +2 -2
  8. data/app/assets/stylesheets/helpdesk/tickets.css.sass +8 -20
  9. data/app/controllers/helpdesk/admin/base_controller.rb +1 -1
  10. data/app/controllers/helpdesk/admin/dashboard_controller.rb +1 -1
  11. data/app/controllers/helpdesk/admin/faqs_controller.rb +1 -1
  12. data/app/controllers/helpdesk/admin/ticket_types_controller.rb +1 -1
  13. data/app/controllers/helpdesk/admin/tickets_controller.rb +16 -15
  14. data/app/controllers/helpdesk/rooter_controller.rb +16 -0
  15. data/app/controllers/helpdesk/subscribers_controller.rb +2 -16
  16. data/app/models/helpdesk/faq.rb +1 -1
  17. data/app/models/helpdesk/subscriber.rb +2 -2
  18. data/app/views/helpdesk/admin/faqs/_form.html.haml +3 -3
  19. data/app/views/helpdesk/admin/faqs/new.html.haml +1 -1
  20. data/app/views/helpdesk/admin/ticket_types/index.html.haml +2 -0
  21. data/app/views/helpdesk/subscribers/index.html.erb +3 -29
  22. data/app/views/helpdesk/tickets/_form.html.haml +4 -9
  23. data/app/views/helpdesk/tickets/_ticket.html.haml +1 -1
  24. data/app/views/helpdesk/tickets/index.html.haml +1 -1
  25. data/config/locales/helpdesk.pl.yml +1 -0
  26. data/config/locales/helpdesk.pt-BR.yml +110 -0
  27. data/config/routes.rb +9 -4
  28. data/lib/generators/helpdesk/templates/helpdesk.rb +4 -0
  29. data/lib/helpdesk.rb +3 -0
  30. data/lib/helpdesk/engine.rb +1 -1
  31. data/lib/helpdesk/version.rb +1 -1
  32. data/lib/route_constraints_faqs.rb +5 -0
  33. data/lib/route_constraints_tickets.rb +5 -0
  34. metadata +70 -82
  35. data/app/assets/stylesheets/helpdesk/imports.css.sass +0 -0
  36. 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
- *= require_self
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
- text-align: center
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
@@ -19,7 +19,7 @@ module Helpdesk
19
19
  end
20
20
 
21
21
  def my_tickets
22
- @my_tickets = Ticket
22
+ @my_tickets = Helpdesk::Ticket
23
23
  .includes(:comments=>[:author])
24
24
  .includes(:requester)
25
25
  .includes(:assignee)
@@ -1,6 +1,6 @@
1
1
  class Helpdesk::Admin::DashboardController < Helpdesk::Admin::BaseController
2
2
 
3
3
  def index
4
- #@tickets = Ticket.all
4
+ #@tickets = Helpdesk::Ticket.all
5
5
  end
6
6
  end
@@ -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.update_all(['position=?', index+1], ['id=?', id])
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
- if params[:tickets] == 'unassigned'
5
- @tickets = Helpdesk::Ticket.unassigned.scoped
6
- elsif params[:tickets] == 'closed'
7
- @tickets = Helpdesk::Ticket.closed.scoped
8
- elsif params[:tickets] == 'active'
9
- @tickets = Helpdesk::Ticket.active.scoped
10
- elsif params[:tickets] == 'all'
11
- @tickets = Helpdesk::Ticket.scoped
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
- .includes(:assignee)
17
- .includes(:ticket_type)
18
- .page(params[:page])
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
- private
71
+ private
71
72
 
72
- def ticket_params
73
- params.require(:ticket).permit(:status,:requester_id,:assignee_id,:ticket_type_id, :subject, :description,comments_attributes:[:author_id, :comment, :public])
74
- end
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 new
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
@@ -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, where('confirmed = ? ',false)
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
- = 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'} }
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'
@@ -1,6 +1,6 @@
1
1
  = render 'menu'
2
2
  - content_for :title do
3
- New faq
3
+ New FAQ
4
4
 
5
5
  = render 'form'
6
6
 
@@ -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>Listing subscribers</h1>
1
+ <h1>New subscriber</h1>
2
2
 
3
- <table>
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
- <% @subscribers.each do |subscriber| %>
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
- / = f.input :subject
11
+ = f.input :subject
12
12
  / = f.input :ticket_type_id, collection: Helpdesk::TicketType.active, include_blank: false
13
- %div.subject
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
- %div.content
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 Helpdesk::Ticket::STATUS_BY_KEY[ticket.status.to_sym], Helpdesk::Ticket::STATUS_CLASS_BY_KEY[ticket.status.to_sym]
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" })
@@ -3,7 +3,7 @@
3
3
  = t('helpdesk.tickets.closed')
4
4
  -else
5
5
  = t('helpdesk.tickets.active')
6
- ="(#{@tickets.total_count})"
6
+ ="(#{@tickets.count})"
7
7
 
8
8
 
9
9
  = render 'menu'
@@ -110,6 +110,7 @@ pl:
110
110
  comment: Dodatkowy opis
111
111
  public: Widoczny/Wyślij
112
112
  helpdesk/ticket:
113
+ ticket_type: Rodzaj zgłoszenia
113
114
  requester_id: Zgłaszający
114
115
  subject: Temat
115
116
  status: Status
@@ -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