helpdesk 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +28 -0
  4. data/app/assets/javascripts/helpdesk/admin/dashboard.js +2 -0
  5. data/app/assets/javascripts/helpdesk/admin/tickets.js +20 -0
  6. data/app/assets/javascripts/helpdesk/application.js +19 -0
  7. data/app/assets/javascripts/helpdesk/ckeditor.js +11 -0
  8. data/app/assets/javascripts/helpdesk/dashboard.js +2 -0
  9. data/app/assets/javascripts/helpdesk/faqs.js +2 -0
  10. data/app/assets/javascripts/helpdesk/subscribers.js +2 -0
  11. data/app/assets/stylesheets/helpdesk/admin/bootstrap_overrides.css +8 -0
  12. data/app/assets/stylesheets/helpdesk/admin/dashboard.css +4 -0
  13. data/app/assets/stylesheets/helpdesk/admin/tickets.css +44 -0
  14. data/app/assets/stylesheets/helpdesk/admin.css +8 -0
  15. data/app/assets/stylesheets/helpdesk/application.css +16 -0
  16. data/app/assets/stylesheets/helpdesk/dashboard.css +4 -0
  17. data/app/assets/stylesheets/helpdesk/faqs.css.scss +3 -0
  18. data/app/assets/stylesheets/helpdesk/imports.css.sass +0 -0
  19. data/app/assets/stylesheets/helpdesk/subscribers.css.scss +3 -0
  20. data/app/assets/stylesheets/helpdesk/tickets.css.sass +49 -0
  21. data/app/controllers/helpdesk/admin/base_controller.rb +32 -0
  22. data/app/controllers/helpdesk/admin/dashboard_controller.rb +6 -0
  23. data/app/controllers/helpdesk/admin/faqs_controller.rb +100 -0
  24. data/app/controllers/helpdesk/admin/subscribers_controller.rb +49 -0
  25. data/app/controllers/helpdesk/admin/ticket_types_controller.rb +52 -0
  26. data/app/controllers/helpdesk/admin/tickets_controller.rb +76 -0
  27. data/app/controllers/helpdesk/application_controller.rb +20 -0
  28. data/app/controllers/helpdesk/dashboard_controller.rb +26 -0
  29. data/app/controllers/helpdesk/faqs_controller.rb +7 -0
  30. data/app/controllers/helpdesk/subscribers_controller.rb +62 -0
  31. data/app/controllers/helpdesk/tickets_controller.rb +91 -0
  32. data/app/helpers/helpdesk/admin/dashboard_helper.rb +6 -0
  33. data/app/helpers/helpdesk/admin/tickets_helper.rb +13 -0
  34. data/app/helpers/helpdesk/dashboard_helper.rb +4 -0
  35. data/app/helpers/helpdesk/faqs_helper.rb +4 -0
  36. data/app/helpers/helpdesk/helpdesk_helper.rb +59 -0
  37. data/app/helpers/helpdesk/subscribers_helper.rb +4 -0
  38. data/app/helpers/helpdesk/tickets_helper.rb +7 -0
  39. data/app/mailers/helpdesk/notifications_mailer.rb +42 -0
  40. data/app/models/helpdesk/comment.rb +31 -0
  41. data/app/models/helpdesk/faq.rb +12 -0
  42. data/app/models/helpdesk/subscriber.rb +10 -0
  43. data/app/models/helpdesk/ticket.rb +85 -0
  44. data/app/models/helpdesk/ticket_type.rb +13 -0
  45. data/app/views/helpdesk/admin/dashboard/index.html.erb +2 -0
  46. data/app/views/helpdesk/admin/faqs/_form.html.haml +20 -0
  47. data/app/views/helpdesk/admin/faqs/_menu.html.haml +9 -0
  48. data/app/views/helpdesk/admin/faqs/edit.html.haml +11 -0
  49. data/app/views/helpdesk/admin/faqs/index.html.haml +59 -0
  50. data/app/views/helpdesk/admin/faqs/new.html.haml +7 -0
  51. data/app/views/helpdesk/admin/faqs/show.html.haml +19 -0
  52. data/app/views/helpdesk/admin/subscribers/_form.html.haml +12 -0
  53. data/app/views/helpdesk/admin/subscribers/_menu.html.haml +9 -0
  54. data/app/views/helpdesk/admin/subscribers/edit.html.haml +10 -0
  55. data/app/views/helpdesk/admin/subscribers/index.html.haml +31 -0
  56. data/app/views/helpdesk/admin/subscribers/new.html.haml +7 -0
  57. data/app/views/helpdesk/admin/ticket_types/_form.html.haml +20 -0
  58. data/app/views/helpdesk/admin/ticket_types/_menu.html.haml +11 -0
  59. data/app/views/helpdesk/admin/ticket_types/edit.html.haml +10 -0
  60. data/app/views/helpdesk/admin/ticket_types/index.html.haml +28 -0
  61. data/app/views/helpdesk/admin/ticket_types/new.html.haml +8 -0
  62. data/app/views/helpdesk/admin/ticket_types/show.html.haml +11 -0
  63. data/app/views/helpdesk/admin/tickets/_form.html.haml +23 -0
  64. data/app/views/helpdesk/admin/tickets/_menu.html.haml +17 -0
  65. data/app/views/helpdesk/admin/tickets/_ticket.html.haml +59 -0
  66. data/app/views/helpdesk/admin/tickets/edit.html.haml +30 -0
  67. data/app/views/helpdesk/admin/tickets/index.html.haml +42 -0
  68. data/app/views/helpdesk/admin/tickets/list.html.haml +18 -0
  69. data/app/views/helpdesk/admin/tickets/new.html.haml +4 -0
  70. data/app/views/helpdesk/admin/tickets/show.html.haml +36 -0
  71. data/app/views/helpdesk/dashboard/index.html.erb +3 -0
  72. data/app/views/helpdesk/faqs/index.html.haml +20 -0
  73. data/app/views/helpdesk/notifications_mailer/comment_by_helpdesk_confirmation.html.haml +15 -0
  74. data/app/views/helpdesk/notifications_mailer/comment_by_helpdesk_notification.html.haml +19 -0
  75. data/app/views/helpdesk/notifications_mailer/comment_by_requester_confirmation.html.haml +16 -0
  76. data/app/views/helpdesk/notifications_mailer/comment_by_requester_notification.html.haml +27 -0
  77. data/app/views/helpdesk/notifications_mailer/ticket_created_confirmation.html.haml +16 -0
  78. data/app/views/helpdesk/notifications_mailer/ticket_created_notification.html.haml +21 -0
  79. data/app/views/helpdesk/subscribers/_form.html.erb +37 -0
  80. data/app/views/helpdesk/subscribers/edit.html.erb +6 -0
  81. data/app/views/helpdesk/subscribers/index.html.erb +31 -0
  82. data/app/views/helpdesk/subscribers/new.html.erb +5 -0
  83. data/app/views/helpdesk/subscribers/show.html.erb +30 -0
  84. data/app/views/helpdesk/tickets/_form.html.haml +36 -0
  85. data/app/views/helpdesk/tickets/_menu.html.haml +10 -0
  86. data/app/views/helpdesk/tickets/_ticket.html.haml +54 -0
  87. data/app/views/helpdesk/tickets/index.html.haml +16 -0
  88. data/app/views/helpdesk/tickets/new.html.haml +4 -0
  89. data/app/views/helpdesk/tickets/show.html.haml +38 -0
  90. data/app/views/layouts/helpdesk/_topmenu.html.haml +28 -0
  91. data/app/views/layouts/helpdesk/_topuser.html.haml +32 -0
  92. data/app/views/layouts/helpdesk/admin.html.haml +35 -0
  93. data/app/views/layouts/helpdesk/user.html.haml +33 -0
  94. data/app/views/layouts/mailer_layout.html.haml +20 -0
  95. data/config/initializers/globalize.rb +4 -0
  96. data/config/initializers/simple_form.rb +117 -0
  97. data/config/locales/helpdesk.en.yml +111 -0
  98. data/config/locales/helpdesk.pl.yml +119 -0
  99. data/config/locales/helpdesk_routes.yml +6 -0
  100. data/config/locales/simple_form.en.yml +24 -0
  101. data/config/locales/simple_form.pl.yml +15 -0
  102. data/config/routes.rb +22 -0
  103. data/db/migrate/20120420104051_create_helpdesk_tickets.rb +14 -0
  104. data/db/migrate/20120423113938_create_helpdesk_comments.rb +12 -0
  105. data/db/migrate/20130521105605_create_helpdesk_ticket_types.rb +36 -0
  106. data/db/migrate/20130522085614_create_helpdesk_faqs.rb +17 -0
  107. data/db/migrate/20130522090420_create_helpdesk_subscribers.rb +13 -0
  108. data/lib/generators/helpdesk/install_generator.rb +35 -0
  109. data/lib/generators/helpdesk/templates/README +31 -0
  110. data/lib/generators/helpdesk/templates/helpdesk.rb +33 -0
  111. data/lib/helpdesk/engine.rb +29 -0
  112. data/lib/helpdesk/version.rb +3 -0
  113. data/lib/helpdesk.rb +39 -0
  114. data/lib/tasks/prepare_ci_env.rake +27 -0
  115. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  116. metadata +508 -0
@@ -0,0 +1,20 @@
1
+ = simple_form_for [:admin, @ticket_type] do |f|
2
+ - if @ticket_type.errors.any?
3
+ #error_explanation
4
+ %h2= "#{pluralize(@ticket_type.errors.count, "error")} prohibited this ticket_type from being saved:"
5
+ %ul
6
+ - @ticket_type.errors.full_messages.each do |msg|
7
+ %li= msg
8
+
9
+
10
+
11
+ - I18n.available_locales.each do |locale|
12
+ %h1
13
+ = locale
14
+ = f.globalize_fields_for locale do |g|
15
+ = g.input :title
16
+
17
+
18
+ = f.input :tr_class
19
+ = f.input :active
20
+ = f.submit 'Save',:class=>'btn btn-promary'
@@ -0,0 +1,11 @@
1
+ - content_for :left do
2
+ = menu_left t('helpdesk.ticket_types.title') do
3
+ = menu_li ico('pencil') + t('helpdesk.ticket_types.new'), new_admin_ticket_type_url
4
+ %li.divider
5
+ = menu_li ico('eye-open') + "#{t('helpdesk.ticket_types.active')} ", admin_ticket_types_url(:ticket_types => 'active')
6
+ = menu_li ico('folder-open') + "#{t('helpdesk.tickets.unassigned')} ", admin_ticket_types_url(:ticket_types => 'inactive')
7
+ %li.divider
8
+ = menu_li ico('list') + t('helpdesk.ticket_types.all'), admin_ticket_types_url(:ticket_types => 'all')
9
+
10
+ / (#{Helpdesk::TicketType.active.count})
11
+ / (#{Helpdesk::TicketType.inactive.count})
@@ -0,0 +1,10 @@
1
+ = render 'menu'
2
+
3
+ - content_for :title do
4
+ Editing ticket_type
5
+
6
+ = render 'form'
7
+
8
+ = link_to 'Show', admin_ticket_type_path(@ticket_type)
9
+ \|
10
+ = link_to 'Back', admin_ticket_types_path
@@ -0,0 +1,28 @@
1
+ = render 'menu'
2
+
3
+ - content_for :title do
4
+ -if params[:ticket_types] && params[:ticket_types] == 'active'
5
+ = t('helpdesk.ticket_types.active')
6
+ -elsif params[:ticket_types] && params[:ticket_types] == 'inactive'
7
+ = t('helpdesk.ticket_types.inactive')
8
+ -else
9
+ = t('helpdesk.ticket_types.all')
10
+
11
+
12
+ %table.table.table-hover
13
+ %tr
14
+ %th Title
15
+ %th
16
+ %th
17
+ %th
18
+
19
+ - @ticket_types.each do |ticket_type|
20
+ %tr{:class=>ticket_type.tr_class}
21
+ %td= ticket_type.title
22
+ %td= link_to 'Show', admin_ticket_type_path(ticket_type)
23
+ %td= link_to 'Edit', edit_admin_ticket_type_path(ticket_type)
24
+ %td= link_to 'Destroy', admin_ticket_type_path(ticket_type), :method => :delete, :data => { :confirm => 'Are you sure?' }
25
+
26
+ %br
27
+
28
+ = link_to 'New Sugestion type', new_admin_ticket_type_path
@@ -0,0 +1,8 @@
1
+ = render 'menu'
2
+
3
+ - content_for :title do
4
+ New ticket_type
5
+
6
+ = render 'form'
7
+
8
+ = link_to 'Back', admin_ticket_types_path
@@ -0,0 +1,11 @@
1
+ = render 'menu'
2
+
3
+ %p#notice= notice
4
+
5
+ %p
6
+ = @ticket_type.title
7
+
8
+
9
+ = link_to 'Edit', edit_admin_ticket_type_path(@ticket_type)
10
+ \|
11
+ = link_to 'Back', admin_ticket_types_path
@@ -0,0 +1,23 @@
1
+ = simple_form_for([:admin, @ticket]) do |f|
2
+ - if @ticket.errors.any?
3
+ %div.error_explanation
4
+ %h2
5
+ = "#{pluralize(@ticket.errors.count, "error")} prohibited this ticket from being saved:"
6
+ %ul
7
+ - @ticket.errors.full_messages.each do |msg|
8
+ %li
9
+ = msg
10
+ = f.input :requester_id, :collection => (Helpdesk.user_class).all,:label_method=>Helpdesk.display_user_uniq_info.to_sym, input_html: { class: 'chosen-select' }
11
+ = f.input :subject
12
+ = f.input :status, :collection => tickets_statuses_for_select, include_blank: false
13
+ = f.input :assignee_id, :collection => helpdesk_admin_collection
14
+ = f.input :ticket_type_id, :collection => Helpdesk::TicketType.active,include_blank: false
15
+ - if @ticket.new_record?
16
+ = f.input :description,input_html:{rows:4}
17
+ - else
18
+ = simple_format @ticket.description
19
+
20
+
21
+ %div.form-actions
22
+ = f.button :submit, :class => 'btn btn-primary'
23
+ = submit_tag 'Anuluj', :type => :reset, :class => "btn btn-danger"
@@ -0,0 +1,17 @@
1
+ - content_for :left do
2
+ = menu_left t('helpdesk.tickets.title') do
3
+ = menu_li ico('pencil') + t('helpdesk.ticket.new'), new_admin_ticket_url
4
+ %li.divider
5
+ = menu_li ico('eye-open') + "#{t('helpdesk.tickets.my')} (#{@my_tickets.size})", admin_tickets_url
6
+ = menu_li ico('bullhorn') + "#{t('helpdesk.tickets.active')} ", admin_tickets_url(:tickets => 'active')
7
+ /(#{Helpdesk::Ticket.active.count})
8
+
9
+ %li.divider
10
+ = menu_li ico('folder-open') + "#{t('helpdesk.tickets.unassigned')} (#{Helpdesk::Ticket.unassigned.count})", admin_tickets_url(:tickets => 'unassigned')
11
+ = menu_li ico('hdd') + "#{t('helpdesk.tickets.closed')} ", admin_tickets_url(:tickets => 'closed')
12
+ / (#{Helpdesk::Ticket.closed.count})
13
+ = menu_li ico('list-alt') + t('helpdesk.tickets.all'), admin_tickets_url(:tickets => 'all')
14
+
15
+ %li.divider
16
+ %li.divider
17
+ = menu_li ico('edit') + t('helpdesk.ticket_types.title'), admin_ticket_types_url
@@ -0,0 +1,59 @@
1
+ %table.table.table-bordered
2
+ %tbody
3
+ %tr{:class=>ticket.ticket_type.tr_class}
4
+ %td{colspan:2}
5
+ %h4
6
+ ="##{ticket.subject}"
7
+ %tr
8
+ %td{style:'width:100px'}
9
+ = I18n::l(ticket.created_at, :format=>:short)
10
+ - if ticket.requester
11
+ = ticket.requester.send Helpdesk.display_user_uniq_info.to_sym
12
+ %td{rowspan:2}
13
+ = status_label humanize_with_i18n(ticket.status,'helpdesk.tickets.statuses'), Helpdesk::Ticket::STATUS_CLASS_BY_KEY[ticket.status.to_sym]
14
+
15
+ = ticket.ticket_type.title
16
+ = auto_link(simple_format(ticket.description), :html => { :target => "_blank" })
17
+ %tr
18
+ %td
19
+ - if ticket.assignee
20
+ = t('helpdesk.tickets.assignee_to')
21
+ = ticket.assignee.send Helpdesk.display_user_uniq_info.to_sym
22
+ - else
23
+ = t('helpdesk.tickets.not_assigned')
24
+ = link_to ico('star') + t('helpdesk.tickets.assign_me'), assign_admin_ticket_path(ticket),class: 'btn btn-mini btn-info'
25
+ %tr
26
+ %td
27
+ %span.btn.disabled
28
+ = ico('comment')
29
+ = ticket.comments.size
30
+ %td
31
+ %ul.comments.unstyled
32
+ - ticket.comments.each do |comment|
33
+ - if comment.persisted?
34
+ %li.comment{:id=>"comment#{comment.id}"}
35
+ %div.comment-left
36
+ - if comment.public
37
+ = status_label ico('envelope') + t('helpdesk.comments.send') ,'label-success'
38
+ - else
39
+ = status_label t('helpdesk.comments.note'),''
40
+ %br
41
+ %a{class:'anchor', href: "#comment#{comment.id}"}
42
+ = "#"
43
+ %div.comment-header
44
+ -if comment.author == ticket.requester
45
+ = status_label ico('user')+ t('helpdesk.comments.author'),'label-info'
46
+ = comment.author.send Helpdesk.display_user_uniq_info.to_sym if comment.author
47
+ %small
48
+ = time_ago_in_words(comment.created_at)
49
+ temu
50
+ %div.comment-body
51
+ = auto_link(simple_format(comment.comment), :html => { :target => "_blank" })
52
+
53
+ %tr{:class=>ticket.ticket_type.tr_class}
54
+ %td{colspan:2}
55
+ - if show_button
56
+ = link_to 'Show', admin_ticket_url(ticket), class: 'btn btn-block'
57
+ -elsif edit_button
58
+ = link_to 'Edit', edit_admin_ticket_url(ticket), class: 'btn btn-primary'
59
+
@@ -0,0 +1,30 @@
1
+ = render 'menu'
2
+ - content_for :title do
3
+ = t('helpdesk.ticket')
4
+ = "##{@ticket.subject}"
5
+ = render 'form'
6
+ %h2
7
+ = t('helpdesk.comments.title')
8
+
9
+ %ul.comments.unstyled
10
+ - @ticket.comments.each do |comment|
11
+ - if comment.persisted?
12
+ %li.comment{:id=>"comment#{comment.id}"}
13
+ %div.comment-left
14
+ - if comment.public
15
+ = status_label ico('envelope') + t('helpdesk.comments.send') ,'label-success'
16
+ - else
17
+ = status_label t('helpdesk.comments.note'),''
18
+ %br
19
+ %a{class:'anchor', href: "#comment#{comment.id}"}
20
+ = "#"
21
+ %div.comment-header
22
+ -if comment.author == @ticket.requester
23
+ = status_label ico('user')+ t('helpdesk.comments.author'),'label-info'
24
+
25
+ = comment.author.send Helpdesk.display_user.to_sym if comment.author
26
+ %small
27
+ = time_ago_in_words(comment.created_at)
28
+ temu
29
+ %div.comment-body
30
+ = simple_format comment.comment
@@ -0,0 +1,42 @@
1
+ = render 'menu'
2
+
3
+ %h1
4
+ -if params[:tickets] && params[:tickets] == 'unassigned'
5
+ = t('helpdesk.unassigned_ticketes')
6
+ -else
7
+ = t('helpdesk.my_tickets')
8
+
9
+ %table.table.table-hover
10
+ %thead
11
+ %tr
12
+ %th= t('helpdesk.status')
13
+ %th ID
14
+ %th Issue Type
15
+ %th Subject
16
+ %th Requester
17
+ %th Requested
18
+ %th Assignee
19
+ %th
20
+
21
+ %tbody
22
+ - @tickets.each do |ticket|
23
+ %tr{:class=>ticket.ticket_type.tr_class}
24
+ %td
25
+ = Helpdesk::Ticket::STATUS_BY_KEY[ticket.status.to_sym]
26
+ %td= ticket.id
27
+ %td= ticket.ticket_type.title
28
+ %td= ticket.subject
29
+ %td
30
+ - if ticket.requester
31
+ = ticket.requester.send Helpdesk.display_user.to_sym
32
+ %br
33
+ = ticket.requester.phone
34
+ %br
35
+ = ticket.requester.email
36
+ %td= I18n::l(ticket.created_at, :format=>:short)
37
+ %td= ticket.assignee if ticket.assignee
38
+ %td= link_to 'Show', admin_ticket_url(ticket)
39
+ %br
40
+
41
+ = paginate @tickets
42
+
@@ -0,0 +1,18 @@
1
+ = render 'menu'
2
+
3
+ - content_for :title do
4
+ -if params[:tickets] && params[:tickets] == 'unassigned'
5
+ = t('helpdesk.tickets.unassigned')
6
+ -elsif params[:tickets] && params[:tickets] == 'closed'
7
+ = t('helpdesk.tickets.closed')
8
+ -elsif params[:tickets] && params[:tickets] == 'active'
9
+ = t('helpdesk.tickets.active')
10
+ -elsif params[:tickets] && params[:tickets] == 'all'
11
+ = t('helpdesk.tickets.all')
12
+ -else
13
+ = t('helpdesk.tickets.my')
14
+
15
+ - @tickets.each do |ticket|
16
+ = render 'ticket', ticket: ticket, show_button:true
17
+
18
+ = paginate @tickets
@@ -0,0 +1,4 @@
1
+ = render 'menu'
2
+ - content_for :title do
3
+ = t('helpdesk.new_ticket')
4
+ = render 'form'
@@ -0,0 +1,36 @@
1
+ = render 'menu'
2
+
3
+ = render 'ticket', :ticket=>@ticket, show_button:false,edit_button:true
4
+
5
+ %table.table
6
+ %tbody
7
+ %tr{:class=>@ticket.ticket_type.tr_class}
8
+
9
+ %td
10
+
11
+ - unless @ticket.open?
12
+ = t('helpdesk.tickets.ticket_closed')
13
+ -else
14
+ = simple_form_for([:admin, @ticket]) do |f|
15
+ - if @ticket.errors.any?
16
+ %div.error_explanation
17
+ %h2
18
+ = "#{pluralize(@ticket.errors.count, "error")} prohibited this ticket from being saved:"
19
+ %ul
20
+ - @ticket.errors.full_messages.each do |msg|
21
+ %li
22
+ = msg
23
+ = f.input :status, :collection => tickets_statuses_for_select, include_blank: false
24
+ = f.input :assignee_id, :collection => helpdesk_admin_collection
25
+
26
+
27
+ = f.simple_fields_for :comments,@ticket.comments.build do |tickets_form|
28
+ - unless tickets_form.object.persisted?
29
+ = tickets_form.input :comment, :input_html=>{class: 'comment-textarea'}
30
+ / , :as => :ckeditor, :input_html => { :ckeditor => {:toolbar => 'mini'},:language => I18n.locale}
31
+
32
+ = tickets_form.input :public, :hint => t('helpdesk.tickets.visible_to_autor')
33
+ = tickets_form.input :author_id, :as => :hidden, :input_html => { :value => helpdesk_user.id }
34
+ %div.form-actions
35
+ = f.button :submit, :class => 'btn btn-primary'
36
+ = submit_tag 'Anuluj', :type => :reset, :class => "btn btn-danger"
@@ -0,0 +1,3 @@
1
+ <h1>Help Desk</h1>
2
+ <h2>Some kind of dashboard</h2>
3
+
@@ -0,0 +1,20 @@
1
+ %div.content
2
+ %div.pageContainer
3
+ %h1
4
+ = t('helpdesk.faqs.title_s')
5
+ %ol#faq
6
+ - @faqs.each do |faq|
7
+ %li{:id=>"link#{faq.id}"}
8
+ %h3
9
+ = link_to faq.title, "\#link#{faq.id}"
10
+ %div{style:"display:none"}
11
+ = raw faq.text
12
+
13
+ - content_for :scripts do
14
+ :javascript
15
+ $(document).ready(function(){
16
+ $('ol#faq li h3').click(function () {
17
+ $(this).parent().find('div').slideToggle('fast');
18
+ });
19
+ $("a[href='" + window.location.hash + "']").click();
20
+ });
@@ -0,0 +1,15 @@
1
+ - content_for :title do
2
+ = t('helpdesk.mailer.comment_by_helpdesk_confirmation.title')
3
+ %p
4
+ = t('helpdesk.mailer.comment_by_helpdesk_confirmation.re_ticket')
5
+ = @comment.ticket.subject
6
+ %p
7
+ = t('helpdesk.mailer.comment_by_helpdesk_confirmation.response_content')
8
+ %br
9
+ = simple_format(@comment.comment)
10
+ %br
11
+ %p
12
+ = t('helpdesk.mailer.ticket_url_title')
13
+ %a{:href=>ticket_url(:locale=>I18n.locale, :id=>@comment.ticket)}<>
14
+ = ticket_url(:locale=>I18n.locale, :id=>@comment.ticket)
15
+ %br
@@ -0,0 +1,19 @@
1
+ - content_for :title do
2
+ = t('helpdesk.mailer.comment_by_helpdesk_notification.title', user: @comment.ticket.requester.send Helpdesk.display_user.to_sym)
3
+ = @comment.ticket.subject
4
+
5
+ %p
6
+ = t('helpdesk.mailer.comment_by_helpdesk_notification.comment_content'_
7
+ %br
8
+ = simple_format(@comment.comment)
9
+ %br
10
+ %p
11
+ = t('helpdesk.mailer.ticket_url_title')
12
+ %a{:href=>ticket_url(:locale=>I18n.locale, :id=>@comment.ticket, :anchor=>"comment#{@comment.id}")}<>
13
+
14
+
15
+
16
+
17
+
18
+
19
+
@@ -0,0 +1,16 @@
1
+ - content_for :title do
2
+ = t('helpdesk.mailer.comment_by_requester_confirmation.title', user: @comment.ticket.requester.send(Helpdesk.display_user.to_sym))
3
+ %p
4
+ = t('helpdesk.mailer.comment_by_requester_confirmation.subject', subject: @comment.ticket.subject)
5
+ %p
6
+ = t('helpdesk.mailer.comment_by_requester_confirmation.comment_content')
7
+ %br
8
+ = simple_format(@comment.comment)
9
+ %br
10
+ %p
11
+ = t('helpdesk.mailer.ticket_url_title')
12
+ %a{:href=>ticket_url(:locale=>I18n.locale, :id=>@comment.ticket)}<>
13
+ = ticket_url(:locale=>I18n.locale, :id=>@comment.ticket)
14
+ %br
15
+ = t('helpdesk.mailer.ticket_created_confirmation.info_time')
16
+
@@ -0,0 +1,27 @@
1
+ - content_for :title do
2
+ = t('helpdesk.mailer.comment_by_requester_notification.title')
3
+ = @comment.ticket.subject
4
+ %p
5
+ = t('helpdesk.mailer.comment_by_requester_notification.comment_content')
6
+ %br
7
+ = simple_format(@comment.comment)
8
+ %br
9
+ %br
10
+ %p
11
+ = t('helpdesk.mailer.ticket_created_notification.requester_info')
12
+ %br
13
+ = @comment.author.send Helpdesk.display_user.to_sym
14
+ %br
15
+ = @comment.author.send Helpdesk.display_user_uniq_info.to_sym
16
+ %br
17
+ %p
18
+ = t('helpdesk.mailer.ticket_url_title')
19
+ %a{:href=>admin_ticket_url(:locale=>I18n.locale, :id=>@comment.ticket)}<>
20
+ = admin_ticket_url(:locale=>I18n.locale, :id=>@comment.ticket)
21
+
22
+
23
+
24
+
25
+
26
+
27
+
@@ -0,0 +1,16 @@
1
+ - content_for :title do
2
+ = t('helpdesk.mailer.ticket_created_confirmation.title', user: @ticket.requester.send(Helpdesk.display_user.to_sym) )
3
+ %p
4
+ = t('helpdesk.mailer.ticket_created_confirmation.subject')
5
+ = @ticket.subject
6
+ %p
7
+ = t('helpdesk.mailer.ticket_created_confirmation.ticket_content')
8
+ %br
9
+ = simple_format(@ticket.description)
10
+ %br
11
+ %p
12
+ = t('helpdesk.mailer.ticket_url_title')
13
+ %a{:href=>ticket_url(:locale=>I18n.locale, :id=>@ticket)}<>
14
+ = ticket_url(:locale=>I18n.locale, :id=>@ticket)
15
+ %br
16
+ = t('helpdesk.mailer.ticket_created_confirmation.info_time')
@@ -0,0 +1,21 @@
1
+ - content_for :title do
2
+ = t('helpdesk.mailer.ticket_created_notification.title')
3
+ = @ticket.ticket_type.title
4
+ %p
5
+ = t('helpdesk.mailer.ticket_created_notification.ticket_content')
6
+ %br
7
+ = simple_format(@ticket.description)
8
+ %br
9
+ %br
10
+ %p
11
+ = t('helpdesk.mailer.ticket_created_notification.requester_info')
12
+ %br
13
+ = @ticket.requester.send Helpdesk.display_user.to_sym
14
+ %br
15
+ = @ticket.requester.send Helpdesk.display_user_uniq_info.to_sym
16
+ %br
17
+ %p
18
+ = t('helpdesk.mailer.ticket_url_title')
19
+ %a{:href=>admin_ticket_url(:locale=>I18n.locale, :id=>@ticket)}<>
20
+ = admin_ticket_url(:locale=>I18n.locale, :id=>@ticket)
21
+
@@ -0,0 +1,37 @@
1
+ <%= form_for(@subscriber) do |f| %>
2
+ <% if @subscriber.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@subscriber.errors.count, "error") %> prohibited this subscriber from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @subscriber.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :name %><br />
16
+ <%= f.text_field :name %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :email %><br />
20
+ <%= f.text_field :email %>
21
+ </div>
22
+ <div class="field">
23
+ <%= f.label :lang %><br />
24
+ <%= f.text_field :lang %>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :hashcode %><br />
28
+ <%= f.text_field :hashcode %>
29
+ </div>
30
+ <div class="field">
31
+ <%= f.label :confirmed %><br />
32
+ <%= f.text_field :confirmed %>
33
+ </div>
34
+ <div class="actions">
35
+ <%= f.submit %>
36
+ </div>
37
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing subscriber</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @subscriber %> |
6
+ <%= link_to 'Back', subscribers_path %>
@@ -0,0 +1,31 @@
1
+ <h1>Listing subscribers</h1>
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>
14
+
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 %>
@@ -0,0 +1,5 @@
1
+ <h1>New subscriber</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', subscribers_path %>
@@ -0,0 +1,30 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <b>Name:</b>
5
+ <%= @subscriber.send Helpdesk.display_user.to_sym %>
6
+ </p>
7
+
8
+ <p>
9
+ <b>Email:</b>
10
+ <%= @subscriber.email %>
11
+ </p>
12
+
13
+ <p>
14
+ <b>Lang:</b>
15
+ <%= @subscriber.lang %>
16
+ </p>
17
+
18
+ <p>
19
+ <b>Hashcode:</b>
20
+ <%= @subscriber.hashcode %>
21
+ </p>
22
+
23
+ <p>
24
+ <b>Confirmed:</b>
25
+ <%= @subscriber.confirmed %>
26
+ </p>
27
+
28
+
29
+ <%= link_to 'Edit', edit_subscriber_path(@subscriber) %> |
30
+ <%= link_to 'Back', subscribers_path %>
@@ -0,0 +1,36 @@
1
+ = simple_form_for @ticket,html:{class: :feedback} do |f|
2
+ %fieldset<>
3
+ - if @ticket.errors.any?
4
+ %div.error_explanation
5
+ %h2
6
+ = "#{pluralize(@ticket.errors.count, "error")} prohibited this ticket from being saved:"
7
+ %ul
8
+ - @ticket.errors.full_messages.each do |msg|
9
+ %li
10
+ = msg
11
+ / = f.input :subject
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
19
+
20
+ - if @ticket.new_record?
21
+ %div.content
22
+ %textarea{:value=>@ticket.description,:name=>"ticket[description]",:type => "text",:placeholder => t('helpdesk.tickets.description')}
23
+ - else
24
+ = @ticket.description
25
+
26
+ = f.simple_fields_for :comments do |tickets_form|
27
+ - unless tickets_form.object.persisted?
28
+ = tickets_form.input :comment
29
+ = tickets_form.input :public, :hint => 'Requester can see this comment (public comment)'
30
+ = tickets_form.input :author_id, :as => :hidden, :input_html => { :value => helpdesk_user.id }
31
+ %hr
32
+ %div.textRight
33
+ %a.class.btn.btn-default{href: root_path }
34
+ = t('helpdesk.tickets.cancel')
35
+ %input{:type => "submit",:value => t('helpdesk.tickets.send'), :class=>"btn btn-primary"}
36
+ %div.clearBoth
@@ -0,0 +1,10 @@
1
+ - content_for :left do
2
+ = menu_left t('helpdesk.tickets.title') do
3
+
4
+ = menu_li ico('pencil') + t('helpdesk.new_ticket'), new_ticket_url
5
+
6
+ %li.divider
7
+
8
+
9
+ = menu_li ico('bullhorn') + "#{t('helpdesk.tickets.active')} (#{@tickets_count})", tickets_url(:tickets => 'active')
10
+ = menu_li ico('hdd') + "#{t('helpdesk.tickets.closed')}", tickets_url(:tickets => 'closed')